Re: count(*), EXISTS, indexes

From: Itai Zukerman <zukerman(at)math-hat(dot)com>
To: josh(at)agliodbs(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: count(*), EXISTS, indexes
Date: 2003-04-11 22:02:37
Message-ID: 87he94r8ua.fsf@matt.w80.math-hat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>> # 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/>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Itai Zukerman 2003-04-11 22:05:32 SELECT INTO TEMP in Trigger?
Previous Message Josh Berkus 2003-04-11 21:42:48 Re: count(*), EXISTS, indexes