Why index don't use with SELECT

Поиск
Список
Период
Сортировка
От Alexander Dederer
Тема Why index don't use with SELECT
Дата
Msg-id 9dut7u$2hdu$1@news.tht.net
обсуждение исходный текст
Ответы Re: Why index don't use with SELECT  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
IMN1=# explain select count(*) from grls WHERE active = 10;
NOTICE:  QUERY PLAN:
Aggregate  (cost=993.21..993.21 rows=1 width=0)
  ->  Seq Scan on grls  (cost=0.00..992.44 rows=307 width=0)

IMN1=# explain select count(*) from grls WHERE popularity = 10;
NOTICE:  QUERY PLAN:
Aggregate  (cost=23.22..23.22 rows=1 width=0)
  ->  Index Scan using grls_popularity on grls  (cost=0.00..23.17 rows=20
width=0)

IMN1=# \di grls
 grls_active         | index | alex
 grls_popularity     | index | alex

Why  SELECT  use Index grls_popularity  and don't use index grls_active ?
Both create and VACUUM ANALYZE grls?

It's a BUG?


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

Предыдущее
От: "Davide"
Дата:
Сообщение: Problem while reading from some tables
Следующее
От: "jacky_shu"
Дата:
Сообщение: NEED Postgresql ODBC driver.