Index scan?

Поиск
Список
Период
Сортировка
От Theo Kramer
Тема Index scan?
Дата
Msg-id 37B3BC04.490D3187@flame.co.za
обсуждение исходный текст
Ответы Re: [HACKERS] Index scan?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi

Does anyone know why the following occurs?
 coza=> explain select * from accounts where domain >= '%' order by domain; NOTICE:  QUERY PLAN:
 Index Scan using domain_idx on accounts  (cost=1434.50 rows=19611 width=106)

and
 coza=> explain select * from accounts order by domain; NOTICE:  QUERY PLAN:
 Sort  (cost=3068.39 rows=58830 width=106)   ->  Seq Scan on accounts  (cost=3068.39 rows=58830 width=106)

Surely both queries give the same result set, yet the second example does not
use the index causing unnecessary overhead.

I am running version 6.5 (haven't upgraded to 6.5.1 as yet)

--------
Regards
Theo


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Ivar Helbekkmo
Дата:
Сообщение: Re: [HACKERS] Re: We won!
Следующее
От: "Hub.Org News Admin"
Дата:
Сообщение: ...