On Jan 18 09:33, Michael Glaesemann wrote: > On Jan 18, 2006, at 20:55 , Volkan YAZICI wrote: > >SELECT t.id > >FROM (SELECT id, sum(1) AS s > > FROM id_n_rights > > WHERE rights = ANY(ARRAY[2,5,10]) > > GROUP BY id) AS t > >WHERE t.s = 3;
AFAICS, the bottleneck in above query is ANY(ARRAY[]) clause usage. Instead of that, if you replace «rights = ANY(ARRAY[2,5,10])» with «rights IN (2,5,10)» it's overhead decreases to 0.200-0.300ms domain. Regards. ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster