Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
locale.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2010 at 18:09 UTC
Updated:
27 Mar 2014 at 15:24 UTC
Jump to comment: Most recent
Comments
Comment #1
damien tournoud commentedAt least PostgreSQL and SQL Server support functional indexes, meaning indexes build on a computed column.
Suppose we implement prefix indexes based on this feature. The Schema API implementation of those database engines will create an index based on
SUBSTRING(source, 1, 30).Now also suppose that instead of querying on:
We query on:
This query will perform nearly as fast as before on MySQL (which will use the index on
s.sourcethat will return one row, then match the substring expression on this row. But on PostgreSQL and SQL Server, it will perform faster then before because the engine will be able to use the computed index to satisfy the query, virtually achieving the same performance as MySQL.Comment #2
andypostMarked as duplicate #771718: (source, context) index is suboptimal
Comment #3
andyposti18n uses own textgroups so I think we should put textgroup into index and change query to
Mostly this query used on multilingual sites so should improve performance
So this help to drop index in #803380: locales_source.location index
Comment #4
andypostDuplicates #851362: Add hash column to {locales_source} to query faster locale strings
Comment #5
Talkless commentedCould someone explain why there are no index on locales_source.source? I do not quite follow.
I've noticed, with Devel modules help, that a lot of small locale queries takes up a lot of time.
Before (Devel module printout):
After adding:
CREATE INDEX locales_source_source_idx ON locales_source(source);I get:
Drupal 7.26 (with Lithuanian language) on Ubuntu Server 12.04.4 amd64 with Postgresql 9.2.4 (I should upgrade that...).
It's already with FileCache, APC opcode cache and EntityCache.