The location module joins on field "location.eid" to the "vid"/"nid"/"uid" field when loading locative data. Field "eid" is not indexed.

The result is a full table scan to look up the location record that matches the node or user being loaded. For queries where multiple nodes are retrieved, this becomes really painfully slow.

(A site I run that is all about locations and maps, http://www.folkjam.org, was showing 1 to 2 million table rows being read to return a list of 0 to 10 matching nodes)

CommentFileSizeAuthor
#3 patch-0.txt1.39 KBharry slaughter

Comments

scott.mclewin’s picture

I just took a look at head to see if this has been resolved in your latest dev line, and it has not.

Is there a sound reason that I'm missing for not having an index on the location.eid field? Any site with large quantities of location records is impacted by not indexing the field used to join location records back to nodes and user entries.

harry slaughter’s picture

subscribing.

With 3100 records, the queries required to generate a view from locations takes about 180,000 ms to run.

Adding an index to location.eid brings that time down to 31ms.

harry slaughter’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

This patch adds an index on location.eid

bdragon’s picture

Status: Needs review » Closed (won't fix)

eid is gone in HEAD.

Feel free to add the index locally for now, but all of the versions this affects are frozen, so wontfixing.

Thanks.