From: Bill O. <bil...@sa...> - 2009-03-05 20:47:55
|
>> select count(*) from rdb$pages where rdb$relation_id = ?; > > It would count pointer pages, not data pages ;) > Nuts!!! In Helen's book, it says on page 969 that RDB$PAGE_TYPE identifies the type of data stored on the page (table data, index, etc.). But, Vlad is right, the data pages aren't printed. Look at this output for table #132. There are 62 data pages, but we only get 2 rows from the query against the system table. The data pages, where page type = 5, aren't printed. I'm sure there is a reason why this was done... Anyone know? C:\SASv9\fbembed>gstat c:\fbdata\fbtest.tdb -u sysdba -p masterkey Database "c:\fbdata\fbtest.tdb" Database header page information: Flags 0 Checksum 12345 Generation 117 Page size 4096 ODS version 11.0 Oldest transaction 51 Oldest active 113 Oldest snapshot 113 Next transaction 114 Bumped transaction 1 Sequence number 0 Next attachment ID 2 Implementation ID 16 Shadow count 0 Page buffers 0 Next header page 0 Database dialect 3 Creation date Mar 5, 2009 10:16:17 Attributes Variable header data: *END* Database file sequence: File c:\fbdata\fbtest.tdb is the only file Analyzing database pages ... PTEST (131) Primary pointer page: 231, Index root page: 232 Data pages: 1, data page slots: 1, average fill: 2% Fill distribution: 0 - 19% = 1 20 - 39% = 0 40 - 59% = 0 60 - 79% = 0 80 - 99% = 0 TESTY (130) Primary pointer page: 227, Index root page: 228 Data pages: 1, data page slots: 1, average fill: 2% Fill distribution: 0 - 19% = 1 20 - 39% = 0 40 - 59% = 0 60 - 79% = 0 80 - 99% = 0 TKTSTYPE (132) Primary pointer page: 155, Index root page: 156 Data pages: 62, data page slots: 62, average fill: 51% Fill distribution: 0 - 19% = 0 20 - 39% = 1 40 - 59% = 61 60 - 79% = 0 80 - 99% = 0 C:\SASv9\fbembed>isql c:\fbdata\fbtest.tdb -u sysdba -p masterkey Database: c:\fbdata\fbtest.tdb, User: sysdba SQL> select * from rdb$pages where rdb$pages.rdb$relation_id = 132; RDB$PAGE_NUMBER RDB$RELATION_ID RDB$PAGE_SEQUENCE RDB$PAGE_TYPE =============== =============== ================= ============= 155 132 0 4 156 132 0 6 SQL> |