Hello,
 
The following query needs about 8 seconds since 3.8. In sqlite-3.7.17 it
was less than a second.
 
select infos.name, infos.id, infos.rating, DateTime(infos.date),
DateTime(infos.expiration)
from infos  
where infos.id not in  
(
  select distinct infos.id from infos, category, category_info where
category_info.category_id=category.id and category_info.item_id=infos.id
and category.name in ('done','monthly','biweekly','weekly')
  or  
  category.id in  
  (
    select distinct category_id from category_alias where name in
('done','monthly','biweekly','weekly')
  )  
  and category.zone in (select zone from zones where zones.zones=5)
)    
and (Date(date)='2014-07-20' OR Date(dateAdded)='2014-07-20')  
and infos.zone in (select zone from zones where zones.zones=1)
group by infos.id order by date, rating;
 
Does anyone have an idea what's the problem with the query planer in
this case?
If I remove the part ...
or 
category.id in ()
... it's mutch faster

Should I post the EXPLAIN?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to