On Thu, Oct 15, 2009 at 9:33 PM, waldomiro <waldom...@shx.com.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. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance