pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc G. Fournier <scrappy@hub.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org, <pgsql-hackers@postgresql.org>
Subject: Re: JOIN between three *simple* tables ...
Date: Wed, 6 Feb 2002 17:41:17 -0400 (AST)
Message-ID: <20020206174041.L57607-100000@earth.hub.org> (raw)
In-Reply-To: <8775.1013030073@sss.pgh.pa.us>


Okay, now I'm annoyed ... I *swear* I ran VACUUM ANALYZE a couple of times
since populating those tables *sigh*  now its bringing up indices I'm
expecting :(

On Wed, 6 Feb 2002, Tom Lane wrote:

> "Marc G. Fournier" <scrappy@hub.org> writes:
> > iwantu=# \d poc_uid
> >  Index "poc_uid"
> >  Column |  Type
> > --------+--------
> >  uid    | bigint
> > btree
>
> > iwantu=# explain select count(1) from orientation_c poc where uid = 1;
> > NOTICE:  QUERY PLAN:
>
> > Aggregate  (cost=2264.97..2264.97 rows=1 width=0)
> >   ->  Seq Scan on orientation_c poc  (cost=0.00..2264.96 rows=1 width=0)
>
> > EXPLAIN
>
> You're forgetting ye olde constant-casting problem.  You need something
> like
>
> 	select count(1) from orientation_c poc where uid = 1::bigint;
>
> to use an index on a bigint column.
>
> Not sure about the other thing; have you VACUUM ANALYZEd (or at least
> ANALYZEd) since filling the tables?  It looks like the system thinks
> the tables are much smaller than they really are.
>
> 			regards, tom lane
>




view thread (3+ messages)

Message-ID: <20020206174041.L57607-100000@earth.hub.org>
Permalink:  ../20020206174041.L57607-100000@earth.hub.org/
Also on:    postgresql.org/message-id/20020206174041.L57607-100000@earth.hub.org

 · 

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: scrappy@hub.org, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: JOIN between three *simple* tables ...
  In-Reply-To: <20020206174041.L57607-100000@earth.hub.org>

* 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