Re: SELECT query results are different depending on whether tablestatistics are available. - Mailing list pgsql-general

From James Brauman
Subject Re: SELECT query results are different depending on whether tablestatistics are available.
Date
Msg-id CAFCW2QPAyPXsEUEzLM6biQsNxLKxGP0qVHAGeZMvkabTFcA4HA@mail.gmail.com
Whole thread Raw
In response to Re: SELECT query results are different depending on whether tablestatistics are available.  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
Thanks for the help David, the query was missing a column in a
PARTITION BY expression.

On Thu, May 28, 2020 at 1:14 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> On Wed, May 27, 2020 at 8:09 PM James Brauman <james.brauman@envato.com> wrote:
>>
>> -- Run select query (involving several CTEs).
>> SELECT ...;
>>
>> I haven't generated a minimal test case yet, but I did notice that if
>> all CTEs in the SELECT query are defined using AS NOT MATERIALIZED the
>> results are always the same regardless of whether the table has been
>> ANALYZED yet.
>>
>> Could anyone share knowledge about why this is happening?
>
>
> A likely scenario is you are missing an ORDER BY in a location where you are depending on deterministic row ordering
andits changing out from underneath you.
 
>
> David J.
>



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: SELECT query results are different depending on whether tablestatistics are available.
Next
From: Laurenz Albe
Date:
Subject: Re: Can't remove default permissions entry