PHP Manual
PEAR Manual
Smarty Manual
PostgreSQL
MySQL Manual
Perl Manual
Ciekawe adresy
- Producent firan
- Canon Katowice
- Adwokat Warszawa
- Budowa domów Poznań
- Konica Minolta
- Platforma e-learning
- Tworzenie Stron WWW Poznań
Czytnik RSS
» Najlepsze serwisy edukacyjne dla uczniówW środę rozpoczął się rok szkolny 2010/2011. Po miłym spotkaniu z koleżankami i kolegami, przyjdzie teraz czas na ciężką pracę. Nauka nie musi być jednak nudna i męcząca. Dzięki serwisom edukacyjnym, poznasz tajniki nauki i języków obcych, nieźle się przy tym bawiąc! Na historii docenisz z pewnością Wikiźródła, a na geografii może Ci się przydać bogata baza filmów i zdjęć National Geographic.
» Energooszczędny monitor LED
Samsung zaprezentował nowy model 19 calowego monitora LED. Koreański producent reklamuje swój nowy wyświetlacz jako urządzenie ekologiczne. Co to znaczy? Nie wykorzystano w nim materiałów szkodliwych dla środowiska, a duży nacisk położono na oszczędzanie energii elektrycznej.
» Chrome 6 - urodzinowa wersja przeglądarki Google
Google świętuje drugie urodziny przeglądarki Chrome i wydaje z tego okazji szóstą, stabilną wersję programu dla systemów Windows, Mac i Linux. Chrome 6 ma być jeszcze szybszy i prostszy w obsłudze. Producent wyeliminował też 16 luk w zabezpieczeniach i błąd związany z jądrem systemu Windows.
» Amiga - reaktywacja
Firma Commodore USA nabyła prawa do posługiwania się marką Amiga. Zamiar spółki to rozpoczęcie sprzedaży komputerów Amiga typu "All in one" - niestety niewiadomo na razie, kiedy to nastąpi.
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