Istedigimiz bazi sorgularin sonuclari diskten fiziksel I/O yapmaktansa memoryden getirebilme yeniligidir. Boylece fiziksel I/O nun neden oldugu Cpu artislarinada bir onlem almis oluruz.
Result cache query’in sonuclarini butun sessionlarin ortak kullanimina acar.aslinda client side ve
server side olarak birbirinden ayirmak lazimdir.Client tarafinda SGA kullanilmaz.
Result_cache_mode diye yeni bir parametremiz gelmistir. Bu parametre Manuel ve force olmak uzere iki secenekten olusur. Manuel modda /*+result_cache */ hintini kullanmamiz lazimdir.
Select /*+ result_cache */ job_id,max(salary) from employees group by job_id gibi
force modda ise otomatik olarak sql result cache kullanilir.
Force modda kullanmak istemezsek /*+no_result_cache*/ hinti tercih edilebilir.CLIENT_RESULT_CACHE_SIZE parametresi ile clientlarin ne kadar result cache sahip olacaklarina karar vereb
iliriz. 0 olmasi disabled olmasi anlamına gelir.
CLIENT_RESULT_CACHE_LAG parametresi ilede ayrica clientlarin ne kadar sıklıkta veritabanı ile sekronize olmasini saglariz.
Tabiki boyle bir ozelliginde CLIENT_RESULT_CACHE_STATS$ monitor edilmesi mumkundur.
SQL> set serveroutput on
SQL> execute dbms_result_cache.memory_report
R e s u l t C a c h e M e m o r y R e p o r t
[Parameters]
Block Size = 1024 bytes
Maximum Cache Size = 950272 bytes (928 blocks)
Maximum Result Size = 47104 bytes (46 blocks)
[Memory]
Total Memory = 46340 bytes [0.048% of the Shared Pool]
... Fixed Memory = 10696 bytes [0.011% of the Shared Pool]
... State Object Pool = 2852 bytes [0.003% of the Shared Pool]
... Cache Memory = 32792 bytes (32 blocks) [0.034% of the Shared Pool]
....... Unused Memory = 30 blocks
....... Used Memory = 2 blocks
........... Dependencies = 1 blocks
........... Results = 1 blocks
............... SQL = 1 blocks
PL/SQL procedure successfully completed.
To remove all existing results and clear the cache memory, use the command:
SQL>execute dbms_result_cache.flush
select name, value from v$result_cache_statistics;
The output of this query will be similar to the following:
NAME VALUE
-------------------- ----------
Block Size (Bytes) 1024
Block Count Maximum 3136
Block Count Current 32
Result Size Maximum (Blocks) 156
Create Count Success 2
Create Count Failure 0
Find Count 0
Invalidation Count 0
Delete Count Invalid 0
Delete Count Valid 0
Block Size (Bytes) |
her memory blogunun size |
Block Count Maximum |
max izin vereilen memory block sayisi |
Block Count Current |
suanda nekadar memeory blogu ayrıldıgı |
Result Size Maximum (Blocks) |
tekbir result cache max. nekadar ayrıldıgı |
Create Count Success |
kac kere basarılı bir sekilde result cache yaratıldı |
Create Count Failure |
kac kere fail etti |
Find Count |
Kac kere basarılı bir sekilde result cache bulundu |
Invalidation Count |
invalidation sayısı |
Delete Count Invalid |
silinen invalid cache |
Delete Count Valid |
silinen valid cache |
bir sistemin SQL query result cache iyi kullandıgının gostergesi Create Count Failure
ve Delete Count Valid
dusuk olmasidir ve find countun yuksek olmasıdır.