Skip to content
Advertisement

Filtering UNION ALL result is much slower than filtering each subquery

I have simple select

that runs slowly. Exactly the same problem as in https://dba.stackexchange.com/questions/136653/filtering-union-all-result-is-much-slower-than-filtering-each-subquery I wonder is there anything I could do without making a function that accepts krepselis as parameter. There is my explain https://pastebin.com/zTBWzkW1 that i use in https://tatiyants.com/pev/#/plans/new

Indexes of private.blt_rezervuota_vieta:

And there is the view itself:

Advertisement

Answer

Solved the problem by casting each union item that points to krepselis, to same database type.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement