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)
Where Will We Go With AI
As AI becomes a more powerful coding tool I could see it taking us in two directions. One would be more and more bad high level code that ...
-
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 ...
-
I started a new 3d unity project to play around with terrain creation. You can add a terrain object and then they have tools for raising a...
-
I have several apps published on the Apple Appstore. Four of them are using iAds and that service is going to be discontinued soon. I am g...
No comments:
Post a Comment