Re: Gained %20 performance after disabling bitmapscan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yavuz Selim Sertoglu <yavuzselim(dot)sertoglu(at)medyasoft(dot)com(dot)tr>
Cc: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Gained %20 performance after disabling bitmapscan
Date: 2018-10-19 13:52:04
Message-ID: 31172.1539957124@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Yavuz Selim Sertoglu <yavuzselim(dot)sertoglu(at)medyasoft(dot)com(dot)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 without time 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vladimir Ryabtsev 2018-10-19 18:09:03 Re: Gained %20 performance after disabling bitmapscan
Previous Message Justin Pryzby 2018-10-19 13:44:55 Re: Gained %20 performance after disabling bitmapscan