Question & Answer
Question
How can I determine how many rows are on a particular extent?
Answer
For internal use only, this document describes steps used to investigate details of a single extent.
First, identify the object ID of the table you are interested in looking at.
nzsql -c "select objid from _v_objects where objname = 'MY_TABLE'";
Once this has been done, run the following command against the SPU containing the extent(s) you are interested in reviewing to identify the sector of the event:
nzsqa disk -priDir -id | grep -E "TableNum|-----|"
The output of the above would look something like this:
TableNum ExtentNum StartSector EntryPtr
-------- --------- ----------- ----------
212854 0 2312195 0x17a2340
If multiple extents exist on this SPU for that object, they would be numbered 0 through n.
The third column is the sector and you can now determine how many rows are on this extent by running the following command:
nzsqa dumpDisk -pri -id 1003 -sector 2132195
The output would be:
Results from known targets:
SPU:1003 'Online' spa = 2 slot = 2, role = 'active' (10.0.2.2:8900)
Block Details for Block at sector 2312195:
Magic CRC BlockN SectorN Length Layout TableId nSectors nRecords CalcCrc
-------- -------- ------ ------- ------ ------ ------- -------- -------- --------
feedface 7c870c0b 0 2312195 328 2 212854 0 8 7c870c0b
Data Contents (256 bytes, 0 offset):
00000000: 00000000 034d5640 00000000 00001490 | .....MV@........
00000010: 00000000 00000000 00140000 00000001 | ................
00000020: 000a7265 636f7264 2031edfe 00000000 | ..record 1......
00000030: 038ef320 00000000 00002014 00000000 | ... ...... .....
00000040: 00000000 000c0200 00000001 00020000 | ................
00000050: 00000000 038ef321 00000000 00002016 | .......!...... .
00000060: 00000000 00000000 000c0200 00000001 | ................
00000070: 00020000 00000000 038ef322 00000000 | ..........."....
00000080: 00002018 00000000 00000000 000c0200 | .. .............
00000090: 00000001 00020000 00000000 038ef323 | ...............#
000000a0: 00000000 0000201a 00000000 00000000 | ...... .........
000000b0: 000c0200 00000001 00020000 00000000 | ................
000000c0: 038ef324 00000000 0000201c 00000000 | ...$...... .....
000000d0: 00000000 000c0200 00000001 00020000 | ................
000000e0: 00000000 038ef325 00000000 0000201e | .......%...... .
000000f0: 00000000 00000000 000c0200 00000001 | ................
To eliminate the data portion, you could alter your command as shown below:
nzsqa dumpDisk -pri -id 1003 -sector 2312195 -count 0
'-count 0' instructs it to report 0 bytes of data. The output from this would simply be:
Results from known targets:
SPU:1003 'Online' spa = 2 slot = 2, role = 'active' (10.0.2.2:8900)
Block Details for Block at sector 2312195:
Magic CRC BlockN SectorN Length Layout TableId nSectors nRecords CalcCrc
-------- -------- ------ ------- ------ ------ ------- -------- -------- --------
feedface 7c870c0b 0 2312195 328 2 212854 0 8 7c870c0b
Data Contents (0 bytes, 0 offset):
Historical Number
NZ669795
Was this topic helpful?
Document Information
Modified date:
17 October 2019
UID
swg21577232