Add index to 'count' in flag_count table
fajerstarter - June 12, 2009 - 08:58
| Project: | Flag |
| Version: | 6.x-1.1 |
| Component: | Flag core |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I run an EXPLAIN on query that did a sort on the 'count' table in 'flag_count', which should be relatively common thing to do, e.g in Views. It gave a "using filesort". I fixed this by adding an index to the 'count' column.

#1
Seems like a good idea to me.
#2
Here's a patch
#3
I combined this with #612602: Add index supporting the relationship in Views, as they both had the same update number. I put specifically in the 2.x branch since Drupal doesn't have any way of detecting if an index already exists and I didn't want to have conflicting updates between the 1.x branch and the 2.x branch. I'll try to hurry up the 2.x version for production use, as this seems like a pretty big improvement in our queries.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.