ORDERED Hint

Moderator: NorbertKrupa

Post Reply
User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

ORDERED Hint

Post by Julie » Tue Jul 08, 2014 1:43 pm

Hey guys,

I heard that there might be a SQL hint in Vertica that is similar Oracle's ORDERED hint that we can use to force the ordering of the table joins. However, I can't find anyone who knows if this is true or not. So I thought I'd see if any of the experts on this site might know ;)
Thanks,
Juliette

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: ORDERED Hint

Post by NorbertKrupa » Tue Jul 08, 2014 3:09 pm

I'm also very curious about this.
Checkout vertica.tips for more Vertica resources.

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: ORDERED Hint

Post by scutter » Tue Jul 08, 2014 3:22 pm

select /*+ add_vertica_options(OPT, ENABLE_SYNTACTIC_OPTIMIZER)*/ …

Not to be used on a regular basis, only if for some reason the optimizer gets the join order wrong. Better to look first at root causes for an incorrect join order such as missing or stale statistics.

Requires using the ansi-style join (ON clause for the join keys, not WHERE).

—Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: ORDERED Hint

Post by NorbertKrupa » Tue Jul 08, 2014 4:03 pm

Sharon always delivers. How does this option work with the rest of the statement to force a early/late materialization ?
Checkout vertica.tips for more Vertica resources.

User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Re: ORDERED Hint

Post by Julie » Tue Jul 08, 2014 6:26 pm

Sharon, that's awesome! THANKS!!! :D :D :D
Thanks,
Juliette

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: ORDERED Hint

Post by scutter » Tue Jul 08, 2014 10:52 pm

Norbert - changing the join order will have an impact on which columns have early materialization. But I don’t really consider materialization when I’m reviewing performance - it is what it is and not something that I can or want to influence.

—Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

User avatar
nnani
Master
Master
Posts: 302
Joined: Fri Apr 13, 2012 6:28 am
Contact:

Re: ORDERED Hint

Post by nnani » Thu Sep 04, 2014 2:30 am

Thanks sharon !!!!
nnani........
Long way to go

You can check out my blogs at vertica-howto

Post Reply

Return to “Vertica SQL”