Sunday, February 21, 2016
MySQL Ignore Index
I had to use something in a MySQL query last week that I haven't needed before. IGNORE INDEX I was aware that you could do this sort of thing, but I don't recall ever using it or seeing it in use before. I have a query that joins a couple tables and looks for records with a particular foreign key value. For some values of that column it was using an index that I added specifically for this query. This was taking 1-2 seconds to run. For other values it would use a different index and take 25-30 seconds to run. I added an IGNORE INDEX for the one that I didn't want. Then it started using a different index that had the same problem, so I had to ignore that one too. Now it seems to be working quickly for all values and using the index that I want. In most cases I have found that the database is pretty good and finding indexes that work best, but I guess not in this case.
Subscribe to:
Post Comments (Atom)
Coding
I'm not sure where I heard this, and it wasn't worded this way, but it helps to think about coding this way. Basically, any progra...

-
I continued working on my 2d project today. I was able to get some other npc characters to animate. I added one of the pre-made killzone o...
-
Some Android applications use space on your Google Drive to store data. You can't see this data by browsing drive the normal way. You ...
-
A few days ago I read about the trolley problem. It was mentioned in an smbc-comics.com comic. I hadn't heard of this before, but I ha...
No comments:
Post a Comment