Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 2D18147585D for ; Wed, 3 Apr 2002 10:56:34 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g33FtVF09507; Wed, 3 Apr 2002 10:55:33 -0500 (EST) To: "Nicholay P. Chuprynin" Cc: pgsql-admin@postgresql.org Subject: Re: INDEX issues In-reply-to: References: Comments: In-reply-to "Nicholay P. Chuprynin" message dated "Wed, 03 Apr 2002 17:25:25 +0500" Date: Wed, 03 Apr 2002 10:55:31 -0500 Message-ID: <9504.1017849331@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/29 X-Sequence-Number: 3918 "Nicholay P. Chuprynin" 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