X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 9C34411F628C for ; Thu, 20 Apr 2006 11:06:32 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.6 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5 tests=[BAYES_00=-2.599, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id 5jgjWelNjTzL for ; Thu, 20 Apr 2006 11:06:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.ecircle.de (mail.ecircle.de [195.140.186.200]) by postgresql.org (Postfix) with ESMTP id 5048D11F61EA for ; Thu, 20 Apr 2006 11:06:22 -0300 (ADT) Received: from deimos.muc.ecircle.de (deimos.muc.ecircle.de [192.168.1.4]) by mail.ecircle.de (READY) with ESMTP id C905755C00F; Thu, 20 Apr 2006 16:06:19 +0200 (CEST) Received: from [192.168.1.91] ([192.168.1.91]) by deimos.muc.ecircle.de with Microsoft SMTPSVC(5.0.2195.6713); Thu, 20 Apr 2006 16:06:19 +0200 Subject: Re: Identical query on two machines, different plans.... From: Csaba Nagy To: mario.splivalo@mobart.hr Cc: Pgsql performance In-Reply-To: <1145541587.3553.30.camel@coppola.muc.ecircle.de> References: <1145541113.9373.9.camel@localhost.localdomain> <1145541587.3553.30.camel@coppola.muc.ecircle.de> Content-Type: text/plain Message-Id: <1145541970.3553.36.camel@coppola.muc.ecircle.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 20 Apr 2006 16:06:11 +0200 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Apr 2006 14:06:19.0734 (UTC) FILETIME=[99047F60:01C66483] X-Archive-Number: 200604/446 X-Sequence-Number: 18530 OK, I marked the wrong row counts, but the conclusion is the same. Cheers, Csaba. > > QUERY PLAN > > --------------------------------------------------------------------------------------------------------------------------------------------------- > > Index Scan using ticketing_codes_uq_value_group_id on ticketing_codes > > (cost=0.00..6.02 rows=1 width=4) (actual time=0.104..0.107 rows=1 > ^^^^^^ > > loops=1) > > Index Cond: (((code_value)::text = 'C7ZP2U'::text) AND (code_group_id > > = 1000)) > > Total runtime: 0.148 ms > > (3 rows) > > > > > > PLAN > > ---------------------------------------------------------------------------------------------------------------------------------------------- > > Bitmap Heap Scan on ticketing_codes (cost=2.01..1102.05 rows=288 > ^^^^^^^^ > > width=4) (actual time=88.164..88.170 rows=1 loops=1) > > Recheck Cond: (((code_value)::text = 'C7ZP2U'::text) AND > > (code_group_id = 1000)) > > -> Bitmap Index Scan on ticketing_codes_uq_value_group_id > > (cost=0.00..2.01 rows=288 width=0) (actual time=54.397..54.397 rows=1 ^^^^^^^^ > > loops=1) > > Index Cond: (((code_value)::text = 'C7ZP2U'::text) AND > > (code_group_id = 1000)) > > Total runtime: 88.256 ms > > (5 rows) > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster