Costs: Index vs Non-Index - Mailing list pgsql-hackers

From The Hermit Hacker
Subject Costs: Index vs Non-Index
Date
Msg-id Pine.BSF.4.21.0001080254230.18498-100000@thelab.hub.org
Whole thread Raw
Responses Re: [HACKERS] Costs: Index vs Non-Index
List pgsql-hackers
Hrmmm...if I'm reading this right, its more costly to create an index then
to leave it as a sequential scan, but it returns more rows?  Yet, it
returns, if I do the query with a count() around the return value, 288
rows, not 334 or 1154...

udmsearch=> explain select next_index_time from url where next_index_time <= 947317073;
NOTICE:  QUERY PLAN:

Seq Scan on url  (cost=43.00 rows=334 width=4)

EXPLAIN
udmsearch=> create index url_next_index_time on url using btree ( next_index_time);
CREATE
udmsearch=> explain select next_index_time from url where next_index_time <= 947317073;
NOTICE:  QUERY PLAN:

Index Scan using url_next_index_time on url  (cost=271.68 rows=1154 width=4)

EXPLAIN



Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Historical trivia (was Re: First Major Open Source Database)
Next
From: Ed Loehr
Date:
Subject: ERROR: out of free buffers: time to abort !