Itai,
> # explain select sum(weight) from rprofile rp where exists (select 1 from
rcount_prof rcp where rcp.profile ~<= rp.profile and ~rcp.psig ~<= rp.psig
and rcp.filter='{734,1944}');
I'm not familiar with the "~" that you have in the query. What are those for?
Do you have an index on rcp.profile, rcp.psig, rcp.filter?
--
-Josh BerkusAglio Database SolutionsSan Francisco