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 recently migrated a site from Magento 1 to Magento 2. The product image thumbnails work differently in Magento 2. In Magento 2 they use ...
-
Here is another small JS project that I built quite a few years ago. It was basically just an exploration of the canvas tag, which was some...
No comments:
Post a Comment