itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,1) |16| f | f |0100000000000000 2| (0,2) |16| f | f |0200000000000000 3| (0,3) |16| f | f |0300000000000000 4| (0,4) |16| f | f |0400000000000000 5| (0,5) |16| f | f |0500000000000000 6| (0,6) |16| f | f |0600000000000000 7| (0,7) |16| f | f |0700000000000000 8| (0,8) |16| f | f |0800000000000000 9| (0,9) |16| f | f |0900000000000000 10| (0,10) |16| f | f |0a 00000000000000
SELECT*FROM bt_page_items('ix_tt2_a',1);
itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,6) |16| f | f |0600000000000000 2| (0,1) |16| f | f |0d 00000000000000 3| (0,8) |16| f | f |1100000000000000 4| (0,3) |16| f | f |1a 00000000000000 5| (0,7) |16| f | f |3400000000000000 6| (0,4) |16| f | f |4000000000000000 7| (0,9) |16| f | f |4100000000000000 8| (0,5) |16| f | f |4600000000000000 9| (0,2) |16| f | f |4b 00000000000000 10| (0,10) |16| f | f |5e 00000000000000
itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,1) |16| f | f |0100000000000000 2| (0,2) |16| f | f |0200000000000000 3| (0,3) |16| f | f |0300000000000000 4| (0,4) |16| f | f |0400000000000000 5| (0,5) |16| f | f |0500000000000000 6| (0,6) |16| f | f |0600000000000000 7| (0,7) |16| f | f |0700000000000000 8| (0,8) |16| f | f |0800000000000000 9| (0,9) |16| f | f |0900000000000000 10| (0,10) |16| f | f |0a 00000000000000 (10rows)
itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,6) |16| f | f |0400000000000000 2| (0,8) |16| f | f |0800000000000000 3| (0,10) |16| f | f |1200000000000000 4| (0,2) |16| f | f |1e 00000000000000 5| (0,5) |16| f | f |2c 00000000000000 6| (0,7) |16| f | f |3600000000000000 7| (0,4) |16| f | f |3e 00000000000000 8| (0,9) |16| f | f |4700000000000000 9| (0,1) |16| f | f |4e 00000000000000 10| (0,3) |16| f | f |5600000000000000
itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,4) |16| f | f |0e 00000000000000 2| (0,5) |16| f | f |1600000000000000 3| (0,1) |16| f | f |1800000000000000 4| (0,9) |16| f | f |1900000000000000 5| (0,19) |16| f | f |1a 00000000000000 6| (0,10) |16| f | f |2600000000000000 7| (0,20) |16| f | f |2700000000000000 8| (0,3) |16| f | f |3200000000000000 9| (0,2) |16| f | f |3e 00000000000000 10| (0,7) |16| f | f |4000000000000000 11| (0,17) |16| f | f |4100000000000000 12| (0,6) |16| f | f |4800000000000000 13| (0,16) |16| f | f |4900000000000000 14| (0,8) |16| f | f |5a 00000000000000 15| (0,18) |16| f | f |5b 00000000000000 (15rows)
itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,1) |16| f | f |0100000000000000 2| (0,2) |16| f | f |0200000000000000 3| (0,3) |16| f | f |0300000000000000 4| (0,4) |16| f | f |0400000000000000 5| (0,5) |16| f | f |0500000000000000 6| (0,6) |16| f | f |0600000000000000 7| (0,16) |16| f | f |0600000000000000 8| (0,7) |16| f | f |0700000000000000 9| (0,17) |16| f | f |0700000000000000 10| (0,8) |16| f | f |0800000000000000 11| (0,18) |16| f | f |0800000000000000 12| (0,9) |16| f | f |0900000000000000 13| (0,19) |16| f | f |0900000000000000 14| (0,10) |16| f | f |0a 00000000000000 15| (0,20) |16| f | f |0a 00000000000000 (15rows)
select relname,schemaname,n_dead_tup as "死元組數", (casewhen n_live_tup >0then n_dead_tup::float8/n_live_tup::float8 else 0 end) as "死/活元組的比例" from pg_stat_all_tables
itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,1) |16| f | f |0100000000000000 2| (0,2) |16| f | f |0200000000000000 3| (0,3) |16| f | f |0300000000000000 4| (0,4) |16| f | f |0400000000000000 5| (0,5) |16| f | f |0500000000000000 6| (0,16) |16| f | f |0600000000000000 7| (0,17) |16| f | f |0700000000000000 8| (0,18) |16| f | f |0800000000000000 9| (0,19) |16| f | f |0900000000000000 10| (0,20) |16| f | f |0a 00000000000000 (10rows)
itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1| (0,4) |16| f | f |0e 00000000000000 2| (0,5) |16| f | f |1600000000000000 3| (0,1) |16| f | f |1800000000000000 4| (0,19) |16| f | f |1a 00000000000000 5| (0,20) |16| f | f |2700000000000000 6| (0,3) |16| f | f |3200000000000000 7| (0,2) |16| f | f |3e 00000000000000 8| (0,17) |16| f | f |4100000000000000 9| (0,16) |16| f | f |4900000000000000 10| (0,18) |16| f | f |5b 00000000000000 (10rows)