public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andrii Novikov <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: Unexpected results from a query with UNION ALL
Date: Thu, 9 Jan 2025 18:49:38 +0200
Message-ID: <CAOS4yi3eT2M-Wx576xRHEZnvHp9C_PrDP1NdXxmyZGB_sJwnMA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAOS4yi14bhxXUCZ_CQFeojAvBzAf9FebtjXsvOTm8KdXb8L14Q@mail.gmail.com>
<[email protected]>
<[email protected]>
Thanks for the update. Actually I was able to rewrite the query to get rid
of the union. But anyway it would be good to have this issue handled
somehow, it's tricky and it was hard to spot and reproduce.
ср, 8 січ. 2025 р. о 19:01 Tom Lane <[email protected]> пише:
> I wrote:
> > Andrey <[email protected]> writes:
> >> ... but I would expect to get the same result as previously. Is it a bug
> >> or am I doing something wrong here?
>
> > It's a surprising result for sure, but I believe it's explained by
> > the algorithm for READ COMMITTED [1], specifically the bit about
>
> Actually, on further thought I believe this really is a bug,
> because if you change the UNION ALL to UNION it works fine.
> It probably used to work with UNION ALL too, but that was a few
> decades ago before we started adding optimizations of UNION ALL :-(
>
> I've been poking at this off and on for the last few days, and I've
> found three different things that will need to be changed to make
> it work again. At least one of them looks too invasive to consider
> for back-patch. So don't hold your breath for a proper fix, but
> perhaps you could use UNION as a workaround?
>
> regards, tom lane
>
view thread (4+ messages)
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Unexpected results from a query with UNION ALL
In-Reply-To: <CAOS4yi3eT2M-Wx576xRHEZnvHp9C_PrDP1NdXxmyZGB_sJwnMA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox