Costs: Index vs Non-Index
От | The Hermit Hacker |
---|---|
Тема | Costs: Index vs Non-Index |
Дата | |
Msg-id | Pine.BSF.4.21.0001080254230.18498-100000@thelab.hub.org обсуждение исходный текст |
Ответы |
Re: [HACKERS] Costs: Index vs Non-Index
|
Список | 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 по дате отправления: