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 9AAAB3A579B for ; Tue, 25 Jan 2005 17:53:36 +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 95225-08 for ; Tue, 25 Jan 2005 17:53:27 +0000 (GMT) Received: from server.cityscape3d.com (unknown [217.206.144.18]) by svr1.postgresql.org (Postfix) with ESMTP id 3CAB23A57C6 for ; Tue, 25 Jan 2005 17:53:26 +0000 (GMT) Received: from [192.168.1.117] ([192.168.1.117]) by server.cityscape3d.com (8.12.11/8.11.6) with ESMTP id j0PHWVet097223; Tue, 25 Jan 2005 17:32:31 GMT (envelope-from chriskl@familyhealth.com.au) Received: from 127.0.0.1 (AVG SMTP 7.0.302 [265.7.3]); Tue, 25 Jan 2005 17:52:28 +0000 Message-ID: <41F6875C.9040804@familyhealth.com.au> Date: Tue, 25 Jan 2005 17:52:28 +0000 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexander Dolgin Cc: pgsql-performance@postgresql.org Subject: Re: 200 times slower then MSSQL?? References: In-Reply-To: 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.121 tagged_above=0 required=5 tests=AWL, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200501/474 X-Sequence-Number: 10164 > with about 8000 rows. For this table query: > > SELECT MAX(MsgSeqNum),MAX(LogTimestamp) FROM ELT_tcli_MessageLog > WHERE LogTimestamp >= '0' AND IsFromCounterParty = 'Y' AND > IsOutOfSequence = 'N' > AND ConnectionName = 'DB_BENCHMARK' > AND LogTimestamp IN (SELECT MAX(LogTimestamp) > FROM ELT_tcli_MessageLog > WHERE MsgSeqNum > 0 AND IsFromCounterParty = 'Y' > > AND IsOutOfSequence = 'N' AND > ConnectionName = 'DB_BENCHMARK') > > takes about 1 second on MSSQL Server and 257 seconds on PostgreSQL one. > > Does anybody have idea about reasons of such results? 1. Have you run vaccum analyze recently? 2. Reply with the output of EXPLAIN ANALYZE SELECT... Chris