Monday, December 5, 2011

Re: Speed of one operation

Oops, I didn't hit send on my reply!

Cloud SQL is compatible with MySQL, so for the most part, you should be able to look at MySQL docs and get your answer. For fulltext indexing, you might want to look at MyISAM:


Are you looking for fulltext indexing or simple equality/inequality matching [select * from users where email IN ( BLAH) ]? If so, you probably can just get away with indexes. MySQL indexing in InnoDB (use InnoDB, just trust me on this) is done via b-trees, so you won't need a full table scan to find these matches:


If the emails are evenly distributed and it's not a lopsided tree, you should be able to complete the search in logarithmic time. You can see how well the indexes are performing by running an explain plan:

explain select * from users where email IN ( BLAH)

A full MySQL tutorial is a bit out of scope of this group, but I just wanted to hit home the fact that much of what's in those docs should apply. If you find any discrepancies, we'd love to know about it.

What exactly is it you are trying to do? There is a full text search feature coming soon, and if you use App Engine's datastore, you can do a get-by-key if the email is a key very quickly.

--
Ikai


No comments:

Post a Comment