Seq. scan when using comparison operators, why? [netaktiv.com #150]

Поиск
Список
Период
Сортировка
От Stephane Bortzmeyer
Тема Seq. scan when using comparison operators, why? [netaktiv.com #150]
Дата
Msg-id 20020408123706.GB1307@staff.netaktiv.com
обсуждение исходный текст
Ответы Re: Seq. scan when using comparison operators, why? [netaktiv.com #150]  (Martijn van Oosterhout <kleptog@svana.org>)
Re: Seq. scan when using comparison operators, why? [netaktiv.com #150]  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I have an index on column "numero". When, I use a WHERE numero=8,
PostgreSQL uses an index scan (OK) but no when using comparison
operators like numero>8.

essais=# explain select * from pourspip where  numero>8;
NOTICE:  QUERY PLAN:

Seq Scan on pourspip  (cost=0.00..22.50 rows=333 width=28)

EXPLAIN
essais=# explain select * from pourspip where  numero=8;
NOTICE:  QUERY PLAN:

Index Scan using numero_idx on pourspip  (cost=0.00..8.14 rows=10 width=28)

EXPLAIN

Why? MySQL seems able to do it "proprely":

mysql> explain select * from pourspip where  numero>8;
+----------+-------+---------------+------------+---------+------+------+------------+
| table    | type  | possible_keys | key        | key_len | ref  | rows | Extra      |
+----------+-------+---------------+------------+---------+------+------+------------+
| pourspip | range | numero_idx    | numero_idx |       5 | NULL |    2 | where used |
+----------+-------+---------------+------------+---------+------+------+------------+






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

Предыдущее
От: Stephane Bortzmeyer
Дата:
Сообщение: Re: dates
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Seq. scan when using comparison operators, why? [netaktiv.com #150]