Re: Postgresql selecting strange index for simple query
| От | Maxim Boguk |
|---|---|
| Тема | Re: Postgresql selecting strange index for simple query |
| Дата | |
| Msg-id | 49A6C0D2.8050906@masterhost.ru обсуждение исходный текст |
| Ответ на | Postgresql selecting strange index for simple query (Maxim Boguk <mboguk@masterhost.ru>) |
| Ответы |
Re: Postgresql selecting strange index for simple query
|
| Список | pgsql-general |
Tom Lane wrote:
> Maxim Boguk <mboguk@masterhost.ru> writes:
>> Somehow postgres think index scan on singlecolumn index slower comparing to scan on 4th field of 4column index.
>
> It does know better than that. I'm wondering if the single-column index
> has become very bloated or something. Have you compared the physical
> index sizes?
Table fresh loaded from dump on test server... So no index bloat for sure...
As for comparing physical sizes, right single column index indeed smaller then wrong one:
Right index:
hh=# SELECT pg_size_pretty(pg_relation_size('resume_last_change_time_idx'));
pg_size_pretty
----------------
125 MB
(1 row)
Wrong index:
hh=# SELECT pg_size_pretty(pg_relation_size('resume_user_id_disabled_is_finished_last_change_time_idx'));
pg_size_pretty
----------------
226 MB
(1 row)
Regards, Maxim Boguk
В списке pgsql-general по дате отправления: