Re: There is a statistic table?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: waldomiro <waldomiro(at)shx(dot)com(dot)br>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: There is a statistic table?
Date: 2009-10-16 04:27:54
Message-ID: dcc563d10910152127l40057b5at910cad4dc7a4ff42@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Oct 15, 2009 at 9:33 PM, waldomiro <waldomiro(at)shx(dot)com(dot)br> wrote:
> Helo everbody!
>
> I need to know how much the postgres is going to disk to get blocks and how much it is going to cache? witch is the statistic table and what is the field that indicates blocks reads from the disk and the memory cache?

Yep. Use psql to access postgres:

psql dbnamehere
\d pg_stat<tab><tab>

and you should get a list like:

pg_stat_activity pg_statio_all_indexes
pg_statio_sys_tables pg_statistic_relid_att_index
pg_stat_user_tables
pg_stat_all_indexes pg_statio_all_sequences
pg_statio_user_indexes pg_stats
pg_stat_all_tables pg_statio_all_tables
pg_statio_user_sequences pg_stat_sys_indexes
pg_stat_bgwriter pg_statio_sys_indexes
pg_statio_user_tables pg_stat_sys_tables
pg_stat_database pg_statio_sys_sequences
pg_statistic pg_stat_user_indexes

just select * from them and you can get an idea what is stored.
Interesting ones right off the bat are:

pg_stat_user_tables
pg_stat_user_indexes
pg_stat_all_tables
pg_stat_all_indexes

but feel free to look around.

> Another question is, what is the best memory configuration to keep more data in cache?

OS or pgsql cache? It's generally better to let the OS do the
majority of caching unless you are sure you can pin shared_buffers in
memory, since allocating too much to shared_buffers may result in
unused portions getting swapped out by some OSes which have aggressive
swapping behaviour. Set shared_buggers to 2G or 1/4 of memory
whichever is smaller to start with, then monitor and adjust from
there.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message keshav upadhyaya 2009-10-16 06:24:44 Re: [PERFORM] Regarding facing lot of time Consumed by Socket.Poll()
Previous Message waldomiro 2009-10-16 03:33:47 There is a statistic table?