Re: use_concat question
Date: Wed, 8 Jun 2022 07:41:05 +0100
Message-ID: <CACj1VR6xM612gHwv3Szcvy-dO0uJzUvLzD=KqaDwRWeSuTGP5A_at_mail.gmail.com>
Hi Laurentiu,
You’ll have to use the additional hint “or_expand” with an argument of the condition number.
Off the top of my head:
/*+ use_concat (or_expand (2)) */
To expand the second filter.
I’ve always been a bit suspicious about how the filters are really ordered for this hint but I believe it’s as you read them left to right. For filters inside parenthesis, the whole group counts as one filter and then the elements of the group count as their own filters.
As with any hinting, a bit of trial-and-error can be done - just hint the use_concat and see what the outline for the plan is reported as. You will be able to grab the full use_concat hint out and modify it to fit your desires.
Obligatory warning, if the optimizer isn’t doing what is best then perhaps there aren’t appropriate statistics. This chain will get messy if we try to address that.
Hope that helps,
Andy
On Wed, 8 Jun 2022 at 07:22, Laurentiu Oprea <laurentiu.oprea06_at_gmail.com> wrote:
> Hello,
>
> For a query which has multiple OR conditions I want to use concatenation
> for just a particular OR condition and not all of them.
>
> Is this achievable in any way?
>
> Thank you.
>
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Jun 08 2022 - 08:41:05 CEST