MySQL Forums
Forum List  »  Performance

Re: GEO Search with large table is very slow
Posted by: Sean Gonsman
Date: April 04, 2009 07:03AM

Thanks Rick,

I believe that I have setup compound indexes. This is when you have multiple columns in a single index, correct?

I have a couple of questions about the way MySQL uses an index with multiple columns. Does it matter how the columns are ordered in the WHERE clause of the SQL statement? For instance, if my indexes is setup like "beds, baths, city", and my WHERE cluase is like "city = 1 AND baths = 2 AND beds = 2" will all of the columns still be used?

I thought that using "IN" was not a range. If it is a range, that is part of the problem because I use beds and baths in the very beginning of the SQL statement. Would it be better to use "beds = 1 OR beds = 2 OR beds = 3" rather than "beds IN(1,2,3)"?

When you have a compound index on multiple columns, it seems that there is a limit to the number of columns you can add. Since latitude and longitude are almost always unique (some properties don't have them), the unique combination of all columns can't be more than the number of rows in the table. Is this correct? In phpMyAdmin, the rows of an index is never bigger than the rows of the table.

Is there anyway to keep the table out of memory so I can see the real speed of the query? Or should I increase the memory buffer so that MySQL stores more in memory to speed things up. My guess is that I would have to increase the memory by a lot to satisfy all of the unique queries.

-Sean

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: GEO Search with large table is very slow
3270
April 04, 2009 07:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.