Re: SELECT query results are different depending on whether table statistics are available.

2020-05-27 Thread James Brauman
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 wrote: > > On Wed, May 27, 2020 at 8:09 PM James Brauman > wrote: >> >> -- Run select query (involving several CTEs). >> SELECT ...; >> >> I haven't

Re: SELECT query results are different depending on whether table statistics are available.

2020-05-27 Thread David G. Johnston
On Wed, May 27, 2020 at 8:09 PM James Brauman 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

SELECT query results are different depending on whether table statistics are available.

2020-05-27 Thread James Brauman
I've ran into a bit of a head scratching situation and was hoping that someone with more knowledge that I could help me understand the behaviour I'm seeing. I'm running on PostgreSQL 12.2. I have a SELECT query that returns different results depending on whether statistics for the table have