Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g08EbLB69619 for ; Tue, 8 Jan 2002 09:37:21 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) 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 g08EbBg23408; Tue, 8 Jan 2002 09:37:11 -0500 (EST) To: Daniel Kalchev cc: pgsql-hackers@postgresql.org Subject: Re: again on index usage In-reply-to: <200201080922.LAA02480@dcave.digsys.bg> References: <200201080922.LAA02480@dcave.digsys.bg> Comments: In-reply-to Daniel Kalchev message dated "Tue, 08 Jan 2002 11:22:03 +0200" Date: Tue, 08 Jan 2002 09:37:11 -0500 Message-ID: <23405.1010500631@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/326 X-Sequence-Number: 17371 Daniel Kalchev writes: > Same result (sorry, should have included this originally): > Aggregate (cost=47721.72..47721.72 rows=1 width=8) > -> Seq Scan on iplog_gate200112 (cost=0.00..47579.54 rows=56873 width=8) >>> If you say "set enable_seqscan to off", does that change the plan? > Aggregate (cost=100359.71..100359.71 rows=1 width=8) > -> Index Scan using iplog_gate200112_ipdate_idx on iplog_gate200112 > (cost=0.00..100217.52 rows=56873 width=8) So, what we've got here is a difference of opinion: the planner thinks that the seqscan will be faster. How many rows are actually selected by this WHERE clause? How long does each plan actually take? regards, tom lane