Povedal som si, že som už dosť veľký nato, aby som sa na to pozrel. Mám pre daný dopyt dva druhy skenovania:
- Unigue Scan - zásadne len na primárnych kľúčoch
- Range Scan (full match) - cudzie kľúče a môj index
Našťastie žiaden natural, či niečo podobné.
Rád by som vedel, v skratke, ako fungujú tieto dva skeny.
DEPOSITS má 16 740 000 záznamov. Najdlhšia tabuľka 4 650 záz. a dve so 4 000. Ostatné sú podstatne kratšie.
Predpokladám, že tu nemám šancu na nejaké zlepšenie/skrátenie času.
Ďakujem. Prikladám celý plán
-> Sort (record length: 892, key length: 252) -> Nested Loop Join (inner)
-> Nested Loop Join (inner)
-> Nested Loop Join (inner)
-> Filter
-> Hash Join (inner)
-> Aggregate
-> Sort (record length: 92, key length: 24)
-> Nested Loop Join (inner)
-> Filter
-> Table "FOCS" as "P FO" Access By ID
-> Bitmap
-> Index "FK_FOCS1" Range Scan (full match)
-> Filter
-> Table "DEPOSITS" as "P D" Access By ID
-> Bitmap
-> Index "I_DEPOSITS_FP" Range Scan (full match)
-> Record Buffer (record length: 57)
-> Filter
-> Aggregate
-> Sort (record length: 92, key length: 24)
-> Nested Loop Join (inner)
-> Filter
-> Table "FOCS" as "C FO" Access By ID
-> Bitmap
-> Index "FK_FOCS1" Range Scan (full match)
-> Filter
-> Table "DEPOSITS" as "C D" Access By ID
-> Bitmap
-> Index "I_DEPOSITS_FP" Range Scan (full match)
-> Nested Loop Join (inner)
-> Filter
-> Table "OWNER_FLAT" as "OWF" Access By ID
-> Bitmap
-> Index "PK_OWNER_FLAT" Unique Scan
-> Filter
-> Table "DEPOSITS" as "D" Access By ID
-> Bitmap And
-> Bitmap
-> Index "FK_DEPOSIT_OWF" Range Scan (full match)
-> Bitmap
-> Index "I_DEPOSITS_FP" Range Scan (full match)
-> Filter
-> Table "FOCS" as "FO" Access By ID
-> Bitmap
-> Index "PK_IDFOCS" Unique Scan
-> Filter
-> Table "BLOCKS" as "B" Access By ID
-> Bitmap
-> Index "FK_BLOCKS_FOCS" Range Scan (full match)
-> Filter
-> Table "OWNERS" as "O" Access By ID
-> Bitmap
-> Index "PK_OWNERS" Unique Scan
-> Filter
-> Table "SERVICEPARAMETERS" as "SP" Access By ID
-> Bitmap
-> Index "PK_SERVICEPARAMETERS" Unique Scan
-> Nested Loop Join (inner)
-> Filter
-> Table "FLATS" as "F" Access By ID
-> Bitmap
-> Index "PKFLATS" Unique Scan
-> Filter
-> Table "ENTRIES" as "E" Access By ID
-> Bitmap
-> Index "PKENTRIES" Unique Scan
-> Filter
-> Table "SERVICES" as "S" Access By ID
-> Bitmap
-> Index "PKSERVICES" Unique Scan