Re: Huge generated UNION ALL faster than JOIN?

2019-05-12 Thread Ancoron Luciferis
On 12/05/2019 20:08, Tom Lane wrote: > Ancoron Luciferis writes: >> One of the things consuming most of the time was an Index Only Scan >> executed millions of times. And on top came the Nested Loop which >> finally reduced the rows but also took a lot of time to do so. > >> Explain plan: https:/

Re: Huge generated UNION ALL faster than JOIN?

2019-05-12 Thread Tom Lane
Ancoron Luciferis writes: > One of the things consuming most of the time was an Index Only Scan > executed millions of times. And on top came the Nested Loop which > finally reduced the rows but also took a lot of time to do so. > Explain plan: https://explain.depesz.com/s/4GYT The core problem

Huge generated UNION ALL faster than JOIN?

2019-05-12 Thread Ancoron Luciferis
Hi, I recently stumbled across an interesting query performance question over at StackOverflow [1], which caught my attention and I started to investigate the issue further. One of the things consuming most of the time was an Index Only Scan executed millions of times. And on top came the Nested