|
148 | 148 | <title>Sample Output</title>
|
149 | 149 |
|
150 | 150 | <screen>
|
151 |
| -regression=# SELECT c.relname, count(*) AS buffers |
| 151 | +regression=# SELECT n.nspname, c.relname, count(*) AS buffers |
152 | 152 | FROM pg_buffercache b INNER JOIN pg_class c
|
153 | 153 | ON b.relfilenode = pg_relation_filenode(c.oid) AND
|
154 | 154 | b.reldatabase IN (0, (SELECT oid FROM pg_database
|
155 | 155 | WHERE datname = current_database()))
|
156 |
| - GROUP BY c.relname |
157 |
| - ORDER BY 2 DESC |
| 156 | + JOIN pg_namespace n ON n.oid = c.relnamespace |
| 157 | + GROUP BY n.nspname, c.relname |
| 158 | + ORDER BY 3 DESC |
158 | 159 | LIMIT 10;
|
159 | 160 |
|
160 |
| - relname | buffers |
161 |
| ----------------------------------+--------- |
162 |
| - tenk2 | 345 |
163 |
| - tenk1 | 141 |
164 |
| - pg_proc | 46 |
165 |
| - pg_class | 45 |
166 |
| - pg_attribute | 43 |
167 |
| - pg_class_relname_nsp_index | 30 |
168 |
| - pg_proc_proname_args_nsp_index | 28 |
169 |
| - pg_attribute_relid_attnam_index | 26 |
170 |
| - pg_depend | 22 |
171 |
| - pg_depend_reference_index | 20 |
| 161 | + nspname | relname | buffers |
| 162 | +------------+------------------------+--------- |
| 163 | + public | delete_test_table | 593 |
| 164 | + public | delete_test_table_pkey | 494 |
| 165 | + pg_catalog | pg_attribute | 472 |
| 166 | + public | quad_poly_tbl | 353 |
| 167 | + public | tenk2 | 349 |
| 168 | + public | tenk1 | 349 |
| 169 | + public | gin_test_idx | 306 |
| 170 | + pg_catalog | pg_largeobject | 206 |
| 171 | + public | gin_test_tbl | 188 |
| 172 | + public | spgist_text_tbl | 182 |
172 | 173 | (10 rows)
|
173 | 174 | </screen>
|
174 | 175 | </sect2>
|
|
0 commit comments