explain and index scan

Поиск
Список
Период
Сортировка
От psql@elbrief.de
Тема explain and index scan
Дата
Msg-id 1330077870.B4dF5f0.5321@debian2
обсуждение исходный текст
Ответы Re: explain and index scan  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список pgsql-general
Hi all.

PostgreSQL 9.1.2 on i686-pc-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 32-bit

 id | integer | not null Vorgabewert nextval('a_id_seq'::regclass)
 a  | integer | not null
 b  | integer | not null
Indexe:
    "a_pkey" PRIMARY KEY, btree (id)
    "a_a_key" UNIQUE CONSTRAINT, btree (a, b)

explain select id from a where a = 1 and b = -90875 ;
                                           QUERY PLAN
-------------------------------------------------------------------------------------------------
 Index Scan using a_a_key on a  (cost=0.00..2.37 rows=1 width=4)
   Index Cond: ((a = 1) AND (b = (-90875)))

 explain select id from a where b = -90875 ;
                                            QUERY PLAN
---------------------------------------------------------------------------------------------------
 Index Scan using a_a_key on a  (cost=0.00..961.76 rows=1 width=4)
   Index Cond: (b = (-90875))

Both select where shown as 'Index Scan'. But the second select is not a real index scan,
its more a seq scan on an index, i think. I think, it would be a good idea to show this in the
explain. Now you can see this only if you look at the cost.

Best regards and thank you for your work,
Andreas

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

Предыдущее
От: "Igor Neyman"
Дата:
Сообщение: Re: Stability in Windows?
Следующее
От: seha
Дата:
Сообщение: Re: When I try to connect to a database, I get the following error : psql teleflowdb8