From: Tom Lane <tgl@sss.pgh.pa.us>
To: AminPG Jaffer <aminjaffer.pg@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Incorrect index used in few cases..
Date: Tue, 18 Jun 2019 09:35:08 -0400
Message-ID: <802.1560864908@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJ9dAqn5UzOQ4wVoCxXPGEu3+WJeZ35xY0bijA4XEpizU8SS5g@mail.gmail.com>
References: <CAJ9dAqn5UzOQ4wVoCxXPGEu3+WJeZ35xY0bijA4XEpizU8SS5g@mail.gmail.com>
AminPG Jaffer <aminjaffer.pg@gmail.com> writes:
> Is there an explanation why it is using incorrect index?
> SQL:
> SELECT count(*) FROM tc WHERE ((tc.a_id = $1)) AND ((tc.m_id = $2)) AND
> ((tc.ag_id is not null)) AND ((tc.id in ($3))) AND ((tc.pt in ($4, $5, $6)))
What data types are these columns? For that matter, could we see the
whole schema for the table (psql \d+ output or equivalent)?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, aminjaffer.pg@gmail.com, pgsql-performance@lists.postgresql.org
Subject: Re: Incorrect index used in few cases..
In-Reply-To: <802.1560864908@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox