I am trying to calculate the cost of the (most efficient) block nested union of loops in terms of NDPR (number of reads on disk). Suppose you have a form request:
SELECT COUNT(*) FROM county JOIN mcd ON count.state_code = mcd.state_code AND county.fips_code = mcd.fips_code WHERE county.state_code = @NO
where @NO is replaced with a status code each time the request is executed.
I know that I can get NPDR using: NPDR(R x S) = |Pages(R)| + Pages(R) / B - 2 . |P ages(S)| NPDR(R x S) = |Pages(R)| + Pages(R) / B - 2 . |P ages(S)|
(where a smaller table is used as an external one in order to create fewer pages. Ergo: R = graph, S = mcd).
I also know that page size = 2048 bytes
Pointer = 8 byte Num. rows in mcd table = 35298 Num. rows in county table = 3141 Free memory buffer pages B = 100 Pages(X) = (rowsize)(numrows) / pagesize
What I'm trying to understand is how " WHERE county.state_code = @NO " affects my value?
Thank you for your time.
Jb2
source share