Re: Make optimized LEFT JOIN with GROUP BY
More wierd things... I used my original query with all the validirano=1 and other tiny int (0 or 1) and know what? I used an index just on datum, ID and it works very fast. I didn't make an index of validirano, jezik, datum, ID... Seems it doesn't matter. Now it shows there is index
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE recepti range recepti_sort recepti_sort 9 NULL 5856 Using where
1 SIMPLE receptislike ref receptislike_idx receptislike_idx 4 kulinarika.recepti.ID 1
Ok, reference is null, I don't know why, but phpmyadmin shows that the query took 20ms now, instead of 200. So I guess I shouldn't bother...