Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id DF1C44764B1 for ; Thu, 30 May 2002 18:06:58 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 5342B475EA3 for ; Thu, 30 May 2002 18:05:12 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g4UM4xW08088; Thu, 30 May 2002 18:04:59 -0400 (EDT) To: Radoslaw Stachowiak Cc: pgsql-admin@postgresql.org Subject: Re: strange inefficiency in shared memory handling In-reply-to: <20020530205101.GC7410@blue.alter.pl> References: <20020530205101.GC7410@blue.alter.pl> Comments: In-reply-to Radoslaw Stachowiak message dated "Thu, 30 May 2002 22:51:01 +0200" Date: Thu, 30 May 2002 18:04:58 -0400 Message-ID: <8084.1022796298@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200205/255 X-Sequence-Number: 4430 Radoslaw Stachowiak writes: > of course this memory removal of cached index blocks is caused by normal > queries and their memory (buffer) requirements, but certainly algorithm > which chose which buffer to remove is a very ineffective on index blocks. > looks to me that it preffer table-block too much (especially compared > to index ones) The buffer management code has absolutely no clue which blocks belong to indexes and which to tables --- it handles all of them on a uniform LRU basis. > with buffers <1000 idx_blks_hit was always smaller than idx_blks_read, > even by 10 times; > statio_user_tables showed that hits were larger than reads by > _great_ amount (factor of 2 and more) - so it shows that shared_buffers > are used very well on tables but not on indexes :-( This seems odd, but I wonder whether it is an artifact of some unusual property of your query workload. You haven't offered enough detail to let someone else try to reproduce it... regards, tom lane