PHP Manual
PEAR Manual
Smarty Manual
PostgreSQL
MySQL Manual
Perl Manual
Ciekawe adresy
- Producent firan
- Prezent dla niego
- Słownik polski duński
- Hostessy Poznań
- Domy Jednorodzinne
- Poduszki Ogrodowe
- Nawigacja
- Płytki Ceramiczne Poznań
Czytnik RSS
» OCZ: dysk SSD za mniej niż 100 USDFirma OCZ zaprezentowała nowy 2,5-calowy dysk SSD z serii Onyx. Urządzenie cechuje się 32-gigabajtową pojemnością oraz atrakcyjną ceną.
» Lepsza ochrona domen .org
Public Interest Registry wdroży w czerwcu br. dla domen .org dodatkowy poziom zabezpieczeń w postaci DNS Security Extensions (DNSSEC), co ma zapewnić lepszą ochronę organizacjom non-profit przed atakami "zatrutego bufora" (cache poisoning).
» Piątkowy Przegląd Prasy
Solorz-Żak chce dzierżawić częstotliwości Centernetu... Pentagon szkoli hakerów... Blokowanie stron www znowu powraca... Mobilny internet nie będzie tanieć... Tepsa bliżej zapłacenia kary 100 mln zł... Koniec wyścigu i kolejek społecznych po dotacje PARP... Bill Gates nie jest już najbogatszy...
» Jak założyć radio internetowe
PC World wyjaśnia jak szybko założyć radio internetowe. Serwerem może być twój domowy komputer. Wystarczy zainstalować Winampa, wtyczkę Edcast i program Icecast2 i możesz rozpocząć karierę prezentera radiowego. Nie musisz mieć zezwolenia Krajowej Rady Radiofonii i Telewizji, ani milionów złotych na sprzęt. Zaczynamy!
chapter 25. monitoring disk usage
- table of contents
- 25.1. determining disk usage
- 25.2. disk full failure
this chapter discusses how to monitor the disk usage of a postgresql database system.
25.1. determining disk usage
each table has a primary heap disk file where most of the data is stored. if the table has any columns with potentially-wide values, there is also a toast file associated with the table, which is used to store values too wide to fit comfortably in the main table (see section 50.2). there will be one index on the toast table, if present. there may also be indexes associated with the base table. each table and index is stored in a separate disk file — possibly more than one file, if the file would exceed one gigabyte. naming conventions for these files are described in section 50.1.
you can monitor disk space from three ways: using sql functions listed in table 9-47, using vacuum information, and from the command line using the tools in contrib/oid2name. the sql functions are the easiest to use and report information about tables, tables with indexes and long value storage (toast), databases, and tablespaces.
using psql on a recently vacuumed or analyzed database, you can issue queries to see the disk usage of any table:
select relfilenode, relpages from pg_class where relname = 'customer'; relfilenode | relpages -------------+---------- 16806 | 60 (1 row)
each page is typically 8 kilobytes. (remember, relpages is only updated by vacuum, analyze, and a few ddl commands such as create index.) the relfilenode value is of interest if you want to examine the table's disk file directly.
to show the space used by toast tables, use a query like the following:
select relname, relpages from pg_class, (select reltoastrelid from pg_class where relname = 'customer') ss where oid = ss.reltoastrelid or oid = (select reltoastidxid from pg_class where oid = ss.reltoastrelid) order by relname; relname | relpages ----------------------+---------- pg_toast_16806 | 0 pg_toast_16806_index | 1
you can easily display index sizes, too:
select c2.relname, c2.relpages from pg_class c, pg_class c2, pg_index i where c.relname = 'customer' and c.oid = i.indrelid and c2.oid = i.indexrelid order by c2.relname; relname | relpages ----------------------+---------- customer_id_indexdex | 26
it is easy to find your largest tables and indexes using this information:
select relname, relpages from pg_class order by relpages desc; relname | relpages ----------------------+---------- bigtable | 3290 customer | 3144
you can also use contrib/oid2name to show disk usage. see readme.oid2name in that directory for examples. it includes a script that shows disk usage for each database.
Najskuteczniejsza reklama to pozycjonowanie - Pozycjonowanie stron <= zajrzyj tu i dowiedz się więcej o pozycjonowanie stron