pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Itai Zukerman <zukerman@math-hat.com>
To: josh@agliodbs.com
Cc: pgsql-sql@postgresql.org
Subject: Re: count(*), EXISTS, indexes
Date: Fri, 11 Apr 2003 18:02:37 -0400
Message-ID: <87he94r8ua.fsf@matt.w80.math-hat.com> (raw)
In-Reply-To: <200304111442.48107.josh@agliodbs.com>
References: <874r54sr8q.fsf@matt.w80.math-hat.com>
	<200304111353.50162.josh@agliodbs.com>
	<871y08sq0e.fsf@matt.w80.math-hat.com>
	<200304111442.48107.josh@agliodbs.com>

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




view thread (14+ messages)  latest in thread

Message-ID: <87he94r8ua.fsf@matt.w80.math-hat.com>
Permalink:  ../87he94r8ua.fsf@matt.w80.math-hat.com/
Also on:    postgresql.org/message-id/87he94r8ua.fsf@matt.w80.math-hat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: zukerman@math-hat.com, josh@agliodbs.com
  Subject: Re: count(*), EXISTS, indexes
  In-Reply-To: <87he94r8ua.fsf@matt.w80.math-hat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox