Re: [BUGS] BUG #14750: Seq Scan instead of Index Scan works without limitation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14750: Seq Scan instead of Index Scan works without limitation
Дата
Msg-id 7335.1500474080@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] BUG #14750: Seq Scan instead of Index Scan works without limitation  (buhhunyx@tut.by)
Ответы Re: [BUGS] BUG #14750: Seq Scan instead of Index Scan works without limitation  (buhhunyx@tut.by)
Список pgsql-bugs
buhhunyx@tut.by writes:
> 1) Create initial structure [1].

> 2) explain analyze SELECT * FROM accounts WHERE accountid = 'accountId50';

>  Index Scan using accounts_pkey on accounts  (cost=0.15..8.17 rows=1
> width=272) (actual time=0.022..0.022 rows=1 loops=1)
>    Index Cond: ((accountid)::text = 'accountId50'::text)
>  Planning time: 0.201 ms
>  Execution time: 0.045 ms

> 3) reindex table ACCOUNTS;

> 4) explain analyze SELECT * FROM accounts WHERE accountid = 'accountId50';

>  Seq Scan on accounts  (cost=0.00..2.50 rows=1 width=142) (actual
> time=0.024..0.037 rows=1 loops=1)
>    Filter: ((accountid)::text = 'accountId50'::text)
>    Rows Removed by Filter: 119
>  Planning time: 0.095 ms
>  Execution time: 0.060 ms

I see no bug here.  The REINDEX caused the system's stats about the table
size to get updated, so the planner now realizes that the table is not
large enough to be worth bothering with an indexscan.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: johncarlo.butil@gmail.com
Дата:
Сообщение: [BUGS] BUG #14752: Cannot re-install Postgres after uninstall
Следующее
От: dilaz03@gmail.com
Дата:
Сообщение: [BUGS] BUG #14753: Bad selectivity estimation with functional partial index