X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 263579FA5D2 for ; Fri, 9 Jun 2006 06:52:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 09806-05 for ; Fri, 9 Jun 2006 06:52:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 01F8E9FA5D8 for ; Fri, 9 Jun 2006 06:52:43 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 9390031DC7; Fri, 9 Jun 2006 11:52:42 +0200 (MET DST) From: "Andrus" X-Newsgroups: pgsql.performance Subject: Re: Why date index is not used Date: Fri, 9 Jun 2006 12:40:26 +0300 Organization: Hub.Org Networking Services Lines: 33 Message-ID: References: <44887875.8000502@fuzzy.cz> <01de01c68b37$33e22a80$8300a8c0@tridecap.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/107 X-Sequence-Number: 19464 > Actually It looks to me like the sorting is the slow part of this query. > Maybe if you did create an index on both kuupaev and kellaaeg it might > make the sorting faster. Thank you. It makes query fast. > Or maybe you could try increasing the server's > work mem. The sort will be much slower if the server can't do the whole > thing in ram. I have W2K server with 0.5 GB RAM there are only 6 connections open ( 6 point of sales) to this server. shared_buffes is 10000 I see approx 10 postgres processes in task manager each taking about 30 MB ram Server prefomance is very slow: Windows swap file size is 1 GB For each sale a new row will be inserted to this table. So the file size grows rapidly every day. Changing work_mem by 1 MB increares memory requirment by 10 MB since I may have 10 processes running. Sorting in memory this table requires very large amout of work_mem for each process address space. I think that if I increase work_mem then swap file will became bigger and perfomance will decrease even more. How to increase perfomance ? Andrus.