X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C660B3A3E4F for ; Wed, 24 Nov 2004 11:02:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18039-09 for ; Wed, 24 Nov 2004 11:02:11 +0000 (GMT) Received: from anchor-post-36.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by svr1.postgresql.org (Postfix) with ESMTP id B917E3A3E44 for ; Wed, 24 Nov 2004 11:02:12 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-36.mail.demon.net with esmtp (Exim 4.42) id 1CWuuW-000Kss-M3; Wed, 24 Nov 2004 11:02:09 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id B940D170B0; Wed, 24 Nov 2004 11:02:06 +0000 (GMT) Message-ID: <41A46A2E.8030606@archonet.com> Date: Wed, 24 Nov 2004 11:02:06 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: BBI Edwin Punzalan Cc: pgsql-performance@postgresql.org Subject: Re: FW: FW: Index usage References: <000701c4d211$f039bfd0$b400a8c0@bluebamboo.ph> In-Reply-To: <000701c4d211$f039bfd0$b400a8c0@bluebamboo.ph> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/375 X-Sequence-Number: 9329 BBI Edwin Punzalan wrote: > Hi. > > 1) chatlogs rows increases every now and then (its in a live environment) > and currently have 538,696 rows OK, so as a rule of thumb I'd say if you were fetching less than 5000 rows it's bound to use an index. If more than 50,000 always use a seqscan, otherwise it'll depend on configuration settings. It looks like you settings are suggesting the cost of an index-scan vs seq-scan are greater than they are. > 2) this is the only problem we experienced. So far, all our other indexes > are being used correctly. Good. > 3) I don't remember tuning any post-installation configuration of our > postgreSQL except setting fsync to false. So long as you know why this can cause data loss. It won't affect this problem. Read that performance article I linked to in the last message, it's written by two people who know what they're talking about. The standard configuration settings are designed to work on any machine, not provide good performance. Work through the basics there and we can look at random_page_cost etc. if it's still causing you problems. -- Richard Huxton Archonet Ltd