From: Shrikant Bhende <shrikantpostgresql@gmail.com>
To: Avinash Kumar <avinash.vallarapu@gmail.com>
To: dbatocloud17@gmail.com
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Query taking seq scan on a table
Date: Sun, 20 Sep 2020 19:18:22 +0530
Message-ID: <CAMTQpJCrPLcbw6vmR2i8S6qbXVG3bLioTG7aCBm1JkBHoFtmrw@mail.gmail.com> (raw)
In-Reply-To: <CAN0TujdziL1CD7FFwKogObZSoe-b1rLLHUPc9m-H+GNbLm5naQ@mail.gmail.com>
References: <CAMTQpJA7eNEXJuLk=Yu5ubo0Wp8xYRwFzzpghRshDYCYPmJHJQ@mail.gmail.com>
<CAN0TujdziL1CD7FFwKogObZSoe-b1rLLHUPc9m-H+GNbLm5naQ@mail.gmail.com>
Hello,
show seq_page_cost; 1
show random_page_cost; 4
storage type : SSD
Table size : 39 GB
There are no columns added, also I haven't found anything where we need to
update the data for older rows.
Thanks
On Sun, Sep 20, 2020 at 6:55 PM Avinash Kumar <avinash.vallarapu@gmail.com>
wrote:
>
>
> On Sun., Sep. 20, 2020, 10:19 a.m. Shrikant Bhende, <
> shrikantpostgresql@gmail.com> wrote:
>
>> Hello all,
>>
>> I am facing issues with one of the queries running on* Amazon Aurora (PG
>> VERSION 9.6)* which is taking more than a minute to complete. As per the
>> initial investigation I assume that one part of the query is taking a
>> sequential scan on a table("wldbowner.member") which is consuming most of
>> the execution time. I tried to use index (Btree and GIN ) as well but none
>> of them were helping to get the query to run faster. Attached is the query
>> along with the explain analyze of the same, any help on the same would be
>> appreciated.
>>
>> NOTE : I have done the vacuum on the table already to get rid of bloat
>> issues.
>> Reindex and test with more work mem is also helping.
>>
> Just wanted to clarify one thing before looking at the query.
>
> What is random_page_cost set to ?
>
>
>> Thanks and regards
>>
>>
>>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: shrikantpostgresql@gmail.com, avinash.vallarapu@gmail.com, dbatocloud17@gmail.com
Subject: Re: Query taking seq scan on a table
In-Reply-To: <CAMTQpJCrPLcbw6vmR2i8S6qbXVG3bLioTG7aCBm1JkBHoFtmrw@mail.gmail.com>
References: <CAMTQpJA7eNEXJuLk=Yu5ubo0Wp8xYRwFzzpghRshDYCYPmJHJQ@mail.gmail.com> <CAN0TujdziL1CD7FFwKogObZSoe-b1rLLHUPc9m-H+GNbLm5naQ@mail.gmail.com> <CAMTQpJCrPLcbw6vmR2i8S6qbXVG3bLioTG7aCBm1JkBHoFtmrw@mail.gmail.com>
* 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