Re: Unique index access path seems very slow

From: Jonathan Lewis <jlewisoracle_at_gmail.com>
Date: Thu, 2 Feb 2023 15:20:46 +0000
Message-ID: <CAGtsp8mL+Ug7cqbnduwMtSfEgUCsHAk5ZOGf_B3qN2ekb77Zvg_at_mail.gmail.com>



Yuhdi,

As I pointed out, I don't think that there's likely to be *much* change in performance by hacking in a different cardinality estimates; but we have seen that the two different figures produce significant changes in WHERE the time is spent and some change in the effectiveness of off-loading. Given that clue (and assuming that there isn't a more important task to address) I would have spent an hour or two re-running the query with a few different cardinality hints between 49K and 2M to see if there was a sweet spot that reduced the CPU required to apply the filter, maximised the effectiveness of offloading, and minimised the number of rows passed up the plan.

IIRC none of the plans showed any writes on the hash join, so I wasn't thinking about overheads of hash joins spilling to disk.

The suggestion for re-engineering the data so that Oracle could iterate through a partition-wise join was also about offload and CPU efficiency. On smaller data volumes a hash table could have both a smaller number of buckets and be more accurate in its distribution, so a Bloom filter could be more effective and cheaper to use on the offload.

The switch to RAW, of course, is mostly about reducing I/O: the very slow runs are probably about resource use by other users on the Cell Servers so a smaler data size means less I/O which means less impact when the hardware gets busy; it did occur to me to wonder if the CPU cost of hashing a 64 byte raw would be less than the cost of hashing a 128 byte varchar (answer: probably) which would also reduce run time and the load on the cell server (and that last one woudl reduce the risk of large volumes of data being sent unprocessed to the database server).

Regards
Jonathan Lewis

On Tue, 31 Jan 2023 at 19:54, yudhi s <learnerdatabase99_at_gmail.com> wrote:

> So Jonathan, OP has supplied plans which shows both cases, I. E, with
> large estimation the bigger bloom filter is consuming additional CPU cycle
> and with smaller estimation the hash join is consuming higher CPU cycle.
> But both the cases the total query execution time is closely equal, also op
> mentioned both the plans running for ~30minutes+ many times of the day
> so...
>
> when you said below I. E favoring large bloom filter option, so I am
> wondering if it's because it might help in less temp spill? Or say, do you
> mean its better option of hinting the inline view or tran_tab estimation
> very high so that a bigger bloom filter will be applied and the lesser
> amounts of rows will be passed to the hash join which may also benefit in
> case of large data volume as temp spill will be minimal?
>
> *Note that the Offload Returned Bytes was 300GB for the 49K estimate with
> the small Bloom filter, and 500GB for the 2M estimate with the large Bloom
> filter.*
> *It looks like we need to "fake" the system so that the Bloom filter
> (estimate) is large enough to eliminate a lot of data while being small
> enough to be sent to the cell server so that the 14 concurrently active
> cells can do the row elimination. Beyond that I don't think there's a way
> to make the query go faster than the (roughly) 650 seconds you've seen so
> far*.
>
>
> On Tue, 31 Jan, 2023, 3:51 am Jonathan Lewis, <jlewisoracle_at_gmail.com>
> wrote:
>
>> Comparing the 5 hash join plans you've posted:
>>
>>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Feb 02 2023 - 16:20:46 CET

Original text of this message