Different query plans when running through application

From: srinivas oguri <srinivasoguri7(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Different query plans when running through application
Date: 2019-10-29 13:46:09
Message-ID: CADfH0ytshR4JghzPtaGJxQYW1jeger000DdVTH=GAZGj8_L0bQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi team,

We have seen a query running from application(Java based) is taking wrong
plan. It is a partitioned table, when the query is executed it is scanning
all partitions. When I execute the query manually from psql it is scanning
the right partition.

1. Stats are up to date (we have scheduled a hourly job to analyze the
table partitions which are used in the query along with tuning autovacuum
process).
2. We are using Amazon aurora with 9.6.9 version.

Please help me in troubleshooting this.

Thanks
Srinivas

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Craig James 2019-10-29 15:41:32 Re: Different query plans when running through application
Previous Message mallikarjun t 2019-10-29 12:11:51 Re: the difference between psql , createdb, dropuser