pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nicholay P. Chuprynin <kolyan@infoport.uz>
Cc: pgsql-admin@postgresql.org
Subject: Re: INDEX issues
Date: Wed, 03 Apr 2002 10:55:31 -0500
Message-ID: <9504.1017849331@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.21.0204031643340.3259-100000@smash.infoport.uz>
References: <Pine.LNX.4.21.0204031643340.3259-100000@smash.infoport.uz>

"Nicholay P. Chuprynin" <kolyan@infoport.uz> writes:
> I switched enable_seqscan to 'false', restarted server and EXPLAINed the
> same query again:
> ...
> Now it uses index scan, but query takes MUCH more time than before (about 
> an hour, and it's not finished yet).
> It seems very strange for me.

Indexscan over a large fraction of a table is not a win compared to
a sequential scan.  Random access is just too expensive.

> Can someone explain what's wrong here?

Nothing.  The planner knew what it was doing to prefer the seqscan.

			regards, tom lane



view thread (2+ messages)

Message-ID: <9504.1017849331@sss.pgh.pa.us>
Permalink:  ../9504.1017849331@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9504.1017849331@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, kolyan@infoport.uz
  Subject: Re: INDEX issues
  In-Reply-To: <9504.1017849331@sss.pgh.pa.us>
  References: <Pine.LNX.4.21.0204031643340.3259-100000@smash.infoport.uz> <9504.1017849331@sss.pgh.pa.us>

* 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