SELECT * FROM comment_upload_files f WHERE f.cid = N ORDER BY f.fid desc;

This query is reported as being slow on drupal.org.

CommentFileSizeAuthor
#2 cu_performance.patch1.09 KBheine

Comments

nnewton’s picture

The index needed here is "alter table add index cid_fid (cid,fid)". On drupal.org, this takes this select from looking at 39k+ rows to 1 row.

heine’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.09 KB

Thanks.

heine’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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