- You can monitor disk space from two places; from inside
-
psql> and from the command line using
-
contrib/oid2name>. Using psql> you can
- issue queries to see the disk usage for any table:
+ You can monitor disk space from three places: from
+
psql> using VACUUM> information, from
+
psql> using contrib/dbsize>, and from
+ the command line using
contrib/oid2name>. Using
+
psql> on a recently vacuumed (or analyzed) database,
+ you can issue queries to see the disk usage of any table:
play=# SELECT relfilenode, relpages
play-# FROM pg_class
- Each page is typically 8 kilobytes. relpages> is only
- updated by VACUUM> and ANALYZE>. To show the
- s
pace used by TOAST> tables, use a query based on the heap
- relfilenode:
+ Each page is typically 8 kilobytes. (Remember, relpages>
+ is only updated by VACUUM> and ANALYZE>.) To
+ s
how the space used by TOAST> tables, use a query based on
+ the heap relfilenode shown above:
play=# SELECT relname, relpages
play-# FROM pg_class
-
+
Indexes
- Testing has shown hash indexes to be similar or slower than btree
- indexes, and the index size and build time for hash indexes is much
- worse. Hash indexes also suffer poor performance under high
- concurrency. For these reasons, hash index use is discouraged.
+ Testing has shown PostgreSQL's hash indexes to be similar or slower
+ than btree indexes, and the index size and build time for hash
+ indexes is much worse. Hash indexes also suffer poor performance
+ under high concurrency. For these reasons, hash index use is
+ discouraged.
the = operator.
- Testing has shown hash indexes to be similar or slower than btree
- indexes, and the index size and build time for hash indexes is much
- worse. Hash indexes also suffer poor performance under high
- concurrency. For these reasons, hash index use is discouraged.
+ Testing has shown PostgreSQL's hash indexes to be similar or slower
+ than btree indexes, and the index size and build time for hash
+ indexes is much worse. Hash indexes also suffer poor performance
+ under high concurrency. For these reasons, hash index use is
+ discouraged.