Vertica not choosing the best projection for join?

Moderator: NorbertKrupa

Post Reply
_pj_
Newbie
Newbie
Posts: 5
Joined: Wed Mar 29, 2017 1:14 pm

Vertica not choosing the best projection for join?

Post by _pj_ » Thu Apr 26, 2018 9:18 am

hi

we have one table T1, and 4 projections on it P1..P4.

P1 is basically only there to filter by ID1 (segmented and ordered by it) and returning only ID1 and ID2.
P2 is segmented and ordered by ID2.
Now if we query T1 by ID1 and join T1 alias T1_2 by ID2 then the query is fast enough for us (less than 1 second. By plan then getting MERGE join and being really fast.

P3 is basically only there to filter by ID3 (segmented and ordered by it) and returning only ID3 and ID4.
P4 is segmented and ordered by ID4.
Now if we query T1 by ID3 and join T1 alias T1_3 by ID4 then the query is NOT fast enough for us (more than 5 seconds). By plan we see that it is using then projection P2 to do the join (and also being then HASH join as the conditions for MERGE are not met) rather than P4 we expected.
If we query T1 by ID3 and join P4 alias T1_3 by ID4 then the query is fast enough for us (less than 1 second).

So if the Query Otimizer would choose the P4 projection in the second query (join over ID4) then we would be happy. Any thoughts, why is this not happening?

Br,
pj

Post Reply

Return to “Vertica Performance Tuning”