@connormcdonald
I help people succeed with the Oracle Database
Nothing here yet.
Nothing here yet.
Fantastic read. In terms of connection pool sizing, I highly recommend the work of Toon Koppelaars. (reference: https://www.neooug.org/gloc/Presentations/2019/Koopelears_ConnectionPoolSizingConcepts.pdf) which recommends pool sizing as: min = max = initial. The TL;DR rationale from the presentation for that recommendation is: unused pool sessions are idle, they do nothing and consume minimal resources because the last thing pool-based apps do is free their resources when they give back a connection. If they dont, then you've got an app bug not a connection pool config issue. the max size setting (by definition) is what you are prepared to let your server handle without undue stress, so why would you pick a min/initial less than that, because to do so means yours apps incurring the cost of creating a connection pseudo-randomly. That makes response times variable.
Here's a hack :-) Add a GROUP BY and a COUNT SQL > create table demo_emps ( 2 id number primary key, 3 name varchar2( 255 ), 4 sal number 5 ); Table created. SQL> SQL > insert into demo_emps values( 1 , 'martin' , 100 ); 1 row created. SQL> SQL > create materialized view log on demo_emps 2 with rowid, sequence, commit scn, primary key (sal) 3 including new values; Materialized view log created. SQL> SQL > create materialized view demo_emps_mv 2 refresh fast on commit 3 as 4 select 1 grp, max(sal) max_sal, count( * ) c 5 from demo_emps 6 group by 1 7 ; Materialized view created. SQL> SQL > select * 2 from demo_emps_mv 3 ; GRP MAX_SAL C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 100 1 SQL > SQL > insert into demo_emps values( 2 , 'sally' , 200 ); 1 row created. SQL> SQL > commit; Commit complete. SQL> SQL > select * 2 from demo_emps_mv 3 ; GRP MAX_SAL C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 200 2 SQL > SQL > select staleness 2 from user_mviews 3 where 1 = 1 4 and mview_name = 'DEMO_EMPS_MV' 5 ; STALENESS - - - - - - - - - - - - - - - - - - - FRESH SQL > SQL > update demo_emps 2 set sal = sal + 1 3 ; 2 rows updated. SQL> SQL > commit; Commit complete. SQL> SQL > select * 2 from demo_emps_mv 3 ; GRP MAX_SAL C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 201 2 SQL > SQL > select staleness 2 from user_mviews 3 where 1 = 1 4 and mview_name = 'DEMO_EMPS_MV' 5 ; STALENESS - - - - - - - - - - - - - - - - - - - FRESH SQL > SQL >