Different query plans when running through application - Mailing list pgsql-admin

From srinivas oguri
Subject Different query plans when running through application
Date
Msg-id CADfH0ytshR4JghzPtaGJxQYW1jeger000DdVTH=GAZGj8_L0bQ@mail.gmail.com
Whole thread Raw
Responses Re: Different query plans when running through application
List 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

pgsql-admin by date:

Previous
From: mallikarjun t
Date:
Subject: Re: the difference between psql , createdb, dropuser
Next
From: Craig James
Date:
Subject: Re: Different query plans when running through application