>> # 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?
They are my own operators and functions. profile is a integer array
and the ~'s are subset operators. psig is a bit signature, "~" is
complement, and the ~ operators again are subset operators.
> Do you have an index on rcp.profile, rcp.psig, rcp.filter?
Yes, yes, and yes. ATM, though, there are only about 50 rows in
rcount_prof. The vast majority of time is spent scanning the
600,000-row rprofile table.
--
Itai Zukerman <http://www.math-hat.com/~zukerman/>