From: Kostas Papadopoulos <kostas@methodosit.com.cy>
To: Daevor The Devoted <dollien@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Same query, same data different plan
Date: Mon, 10 Oct 2022 16:05:42 +0300
Message-ID: <8da58bc7-a01a-0168-3d49-062258ac82ec@methodosit.com.cy> (raw)
In-Reply-To: <CAAZnbVoCXD0d6AKDjoEUD2NXzH1KugMUGy69Whs0_tfH-LPXcw@mail.gmail.com>
References: <20b3e283-3107-cd18-6e7f-90ed58e7ddf8@methodosit.com.cy>
<CAAZnbVoCXD0d6AKDjoEUD2NXzH1KugMUGy69Whs0_tfH-LPXcw@mail.gmail.com>
Hi,
Yes, I ran ANALYZE in both databases.
Kostas
On 10/10/2022 16:03, Daevor The Devoted wrote:
> Hi
>
> Is the table stats up to date on both?
>
> https://www.postgresql.org/docs/current/planner-stats.html
>
> Best regards,
> Na-iem Dollie
>
> On Mon, Oct 10, 2022 at 2:56 PM Kostas Papadopoulos <
> kostas@methodosit.com.cy> wrote:
>
>>
>> I have two identical databases running in the same instance of Postgresql.
>> Ran
>> analyze on both. Running the same query I'm getting different plans, one
>> x10 slower.
>> Although I have solved my problem by re-writing the query, I want to
>> understand why
>> this is happening. If the configuration, Postgresql version, schema and
>> data are the
>> same, what other factors is the planner considering?
>>
>> --
>>
>> Kostas Papadopoulos
>> KE MethodosIT
>>
>>
>>
>>
>
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-general@postgresql.org
Cc: kostas@methodosit.com.cy, dollien@gmail.com
Subject: Re: Same query, same data different plan
In-Reply-To: <8da58bc7-a01a-0168-3d49-062258ac82ec@methodosit.com.cy>
References: <20b3e283-3107-cd18-6e7f-90ed58e7ddf8@methodosit.com.cy> <CAAZnbVoCXD0d6AKDjoEUD2NXzH1KugMUGy69Whs0_tfH-LPXcw@mail.gmail.com> <8da58bc7-a01a-0168-3d49-062258ac82ec@methodosit.com.cy>
* 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