"Alexander Batyrshin" <[EMAIL PROTECTED]> wrote: > Hello everyone. > I've discover performance degradation due to update 3.3.17 -> 3.5.4. > This SQL query work very slowly: > > DELETE FROM > population_stamp > WHERE > town_id IN ( > SELECT DISTINCT town_id FROM population_stamp > EXCEPT > SELECT id FROM town > ); >
I'll bet it will go a lot faster in both 3.3.17 and 3.5.4 if you omit the DISTINCT operator. EXCEPT implies DISTINCT anyway, so you are not losing anything. But SQLite does not optimize out redundant DISTINCTs so it is computing the DISTINCT twice. -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------