Re: Gained %20 performance after disabling bitmapscan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Gained %20 performance after disabling bitmapscan
Дата
Msg-id 31172.1539957124@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Gained %20 performance after disabling bitmapscan  (Yavuz Selim Sertoglu <yavuzselim.sertoglu@medyasoft.com.tr>)
Ответы Ynt: Gained %20 performance after disabling bitmapscan
Список pgsql-performance
Yavuz Selim Sertoglu <yavuzselim.sertoglu@medyasoft.com.tr> writes:
> I have a problem with my query. Query always using parallel bitmap heap scan.

Have you messed with the parallel cost parameters?  It seems a bit
surprising that this query wants to use parallelism at all.

>         Index Cond: (((mukellef_id)::text = '0123456789'::text) AND (kayit_tarihi >= '2018-01-01 00:00:00'::timestamp
withouttime zone) AND (sube_no = '-13'::integer) AND ((defter)::text = 'sm'::text)) 

If that's your normal query pattern, then this isn't a very good
index design:

>     Column    |            Type             |  Definition
> --------------+-----------------------------+--------------
>  mukellef_id  | character varying(12)       | mukellef_id
>  kayit_tarihi | timestamp without time zone | kayit_tarihi
>  sube_no      | integer                     | sube_no
>  defter       | character varying(4)        | defter
>  id           | bigint                      | id

The column order should be mukellef_id, sube_no, defter, kayit_tarihi, id
so that the index entries you want are adjacent in the index.

Of course, if you have other queries using this index, you might need
to leave it as-is --- but this is the query you're complaining about...

            regards, tom lane


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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: Gained %20 performance after disabling bitmapscan
Следующее
От: Vladimir Ryabtsev
Дата:
Сообщение: Re: Gained %20 performance after disabling bitmapscan