Thanks, this now works with 22.0.482.
I fell after testing that this is client side filtering, not forwarded to the server ?
When the table is big, that creates huge payloads, possibly breaking the limits.
Yes, group functions are evaluated client-side only.
It would technically be possible to off-load it to a limited number of backend servers such as the ANSI SQL-based sources, but that is commercially not yet viable.
To reduce volume, we recommend using a native statement or using a pre-aggregated database view on MySQL. For example a piece of code to select the most recent entry in a logging table of over 50 GB:
begin
create or replace table lgg_selection@inmemorystorage
as
select 1 lgg_id_max, sysdateutc lgg_date_created_min
from DUAL@DataDictionary
where 1=0
;
for r in
( execute native
' select lgg1.lgg_id_max'
|| ' , lgg2.date_created lgg_date_created_min'
|| ' from (select max(lgg.id) lgg_id_max, min(lgg.id) lgg_id_min from my_logging lgg where lgg.id >= ${LGG_ID_START}) lgg1'
|| ' join my_logging lgg2'
|| ' on lgg2.id = lgg1.lgg_id_min'
datacontainer 'somecontaineralias'
)
loop
insert into lgg_selection@inmemorystorage
( lgg_id_max
, lgg_date_created_min
)
values
( r.lgg_id_max
, r.lgg_date_created_min
);
end loop;
end;