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

quicksketch - June 13, 2009 - 21:10
Category:bug report» task

Seems like a good idea to me.

#2

voxpelli - October 23, 2009 - 11:42
Version:6.x-1.x-dev» 6.x-1.1
Status:active» needs review

Here's a patch

AttachmentSize
flag_improved_index_flag_counts_issue_489610.patch 836 bytes

#3

quicksketch - October 26, 2009 - 21:45
Status:needs review» fixed

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.

AttachmentSize
flag_indexes.patch 1.7 KB

#4

System Message - November 9, 2009 - 21:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.