X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2F02011F6CD6 for ; Thu, 20 Apr 2006 11:00:10 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 required=5 tests=[none] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id PBeznBves5Rc for ; Thu, 20 Apr 2006 10:59:58 -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 4F75911F6CC7 for ; Thu, 20 Apr 2006 10:59:59 -0300 (ADT) Received: from deimos.muc.ecircle.de (deimos.muc.ecircle.de [192.168.1.4]) by mail.ecircle.de (READY) with ESMTP id BDA1B55C013; Thu, 20 Apr 2006 15:59:56 +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 15:59:56 +0200 Subject: Re: Identical query on two machines, different plans.... From: Csaba Nagy To: mario.splivalo@mobart.hr Cc: Pgsql performance In-Reply-To: <1145541113.9373.9.camel@localhost.localdomain> References: <1145541113.9373.9.camel@localhost.localdomain> Content-Type: text/plain Message-Id: <1145541587.3553.30.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 15:59:48 +0200 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Apr 2006 13:59:56.0671 (UTC) FILETIME=[B4B1B8F0:01C66482] X-Archive-Number: 200604/444 X-Sequence-Number: 18528 You very likely forgot to run ANALYZE on your laptop after copying the data. Observe the different row count estimates in the 2 plans... HTH, 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) >