wow.. when I export "All releases merged" file, it took 8 sec to export from my computer. dig inside... seems missing an index

do full scan..

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE l ALL fid,sid NULL NULL NULL 353166 Using temporary; Using filesort
1 SIMPLE s eq_ref PRIMARY PRIMARY 4 l10n2.l.sid 1  
1 SIMPLE st eq_ref PRIMARY,sid_language_has_suggestion,sid_language_h... PRIMARY 42 l10n2.s.sid,const 1  
1 SIMPLE t ref is_suggestion_is_active_language,sid_language_is_s... sid_language_is_suggestion_is_active 50 l10n2.l.sid,const,const,const 2  
1 SIMPLE f eq_ref PRIMARY PRIMARY 4 l10n2.l.fid 1 Using where

add pid index

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE f ref PRIMARY,pid pid 5 const 400 Using where; Using temporary; Using filesort
1 SIMPLE l ref fid,sid fid 5 l10n2.f.fid 14 Using where
1 SIMPLE s eq_ref PRIMARY PRIMARY 4 l10n2.l.sid 1  
1 SIMPLE st eq_ref PRIMARY,sid_language_has_suggestion,sid_language_h... PRIMARY 42 l10n2.s.sid,const 1  
1 SIMPLE t ref is_suggestion_is_active_language,sid_language_is_s... sid_language_is_suggestion_is_active 50 l10n2.l.sid,const,const,const 2  

save 33x times ^_^

CommentFileSizeAuthor
#6 pid-index-on-file.patch1010 bytesgábor hojtsy
#4 l10n.patch821 bytesdroplet

Comments

gábor hojtsy’s picture

Can you provide a quick patch for this? That would be really helpful. Thanks!

droplet’s picture

oh my god. this also help us improve "Compact files optimized for size, not desktop editing" speed, guess this is used in LDO export to ftp.

save 2x time

gábor hojtsy’s picture

Well, the package builder always builds packages for specific releases of modules, not generally for the whole module without release (at least not currently). So a pid index would not help as much (rid *is* indexed). An index on *pid* would help indeed if you are about to build a .po file covering all releases which l.d.o does not do in an automated way. It is only done when you specifically request for it.

Regardless if it speeds up that query as much, it does not look like we should skip adding it in (possibly with a note that it is more rarely used but valid for that use case).

droplet’s picture

Status: Active » Needs review
StatusFileSize
new821 bytes

ok.

specific Release + "Compact files optimized for size, not desktop editing" do not take right index
1 SIMPLE t ALL is_suggestion_is_active_language,sid_language_is_s... NULL NULL NULL 3644 Using where; Using temporary; Using filesort

quick patch

droplet’s picture

"So a pid index would not help as much (rid *is* indexed). "

no no ..... my test above (#4) is specified Release + "Compact files optimized for size, not desktop editing"

(I will dig into builds packages soon to see if anything is diff... but I guess the query is same..)

^_^

gábor hojtsy’s picture

Status: Needs review » Fixed
StatusFileSize
new1010 bytes

Here is a reroll which should be more complete (also adds it on new installs). Committing this.

Status: Fixed » Closed (fixed)

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