A look at the techniques that middle tier developers can employ to get greater value out of their applications, simply by having an understanding of how the database works and how to make it sing.
23. 23
"fine-grained to perform a single function"
"Each service is ... minimal, and complete"
https://en.wikipedia.org/wiki/Microservices
select COUNT(*)
from PEOPLE
where GENDER = 'MALE'
27. 27
"By abstracting the underlying implementation"
"describes the expected behaviour ... but can have multiple implementations"
https://en.wikipedia.org/wiki/Application_programming_interface
select NAME, STREET_NO, ZIP_CODE
from PEOPLE p,
ADDRESS a
where p.AGE > 50
and p.ADDRESS_ID = a.ADDRESS_ID;
59. spinning
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
can I have the latch ?
59
74. • Get latch
• Search along list of blocks in memory (or "chain")
• Read block
• Extract row of interest
• Release latch
• Give row back to client
"fetch a row"
74
78. rs = stmt.executeQuery("...");
while(rs.next()) {
v1 = rs.getInt(1);
v2 = rs.getString(2);
...
}
• Get latch
• Walk along chain
• Get block
• Extract single row
• Release latch
• Give row back to client
• Get latch (again)
• Walk along chain (again)
• Get block (again)
• Extract single row
• Release latch (again)
• Give row back to client (again)
Row #1
Row #2
• Get latch (again)
• Walk along chain (again)
• Get block (again)
• Extract single row
• Release latch (again)
• Give row back to client (again)
Row #3
78
80. "fetch a row"
• Get latch
• Walk along chain
• Get block
• Pin the block
• Release latch
• Give row 1 back to client
• Give row 2 back to client
…
• Give row n to client
• Get latch
• Walk along chain
• Remove my pin on the block
• Release latch
“and .. I’ll will need
several rows from
this block”
105. SQL> select name, gets
2 from v$latch
3 where name like 'library%' or name like 'shared%';
NAME GETS
------------------------------ ----------
shared pool 333907
shared pool simulator 7191
shared pool sim alloc 133
shared server configuration 6
shared server info 1
SQL> select 0 from dual;
0
----------
0
GETS
----------
333991 = 84
7196 = 5
135 = 2
6
1