Re: Postgres not using indices defined on my table with certain queries using "in"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "s anwar" <sanwar(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Postgres not using indices defined on my table with certain queries using "in"
Date: 2007-07-05 20:35:29
Message-ID: 21442.1183667729@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"s anwar" <sanwar(at)gmail(dot)com> writes:
> Thank you for your response. The actual table that will have 400
> million rows. The last time I created an index on an integer field on
> a table that size it was too big for Postgres to use (to high a cost
> of using the index). Hence, Postgres reverted back to sequential scan.

I rather doubt that you analyzed that situation correctly. An index
being large is not a reason not to use it (since the table will also be
large, hence the seqscan cost is even higher). However, with no details
it's impossible to guess the real reason the index wasn't being used.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Raimon Fernandez 2007-07-05 20:51:37 Re: subquery with more than one column
Previous Message s anwar 2007-07-05 19:59:17 Re: Postgres not using indices defined on my table with certain queries using "in"