X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A20BFD7AF6 for ; Thu, 22 Sep 2005 19:28:29 -0300 (ADT) 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 36298-05 for ; Thu, 22 Sep 2005 22:28:25 +0000 (GMT) Received: from BAYC1-PASMTP02.BAYC1.HOTMAIL.COM (bayc1-pasmtp02.bayc1.hotmail.com [65.54.191.162]) by svr1.postgresql.org (Postfix) with ESMTP id 49258D7AB7 for ; Thu, 22 Sep 2005 19:28:26 -0300 (ADT) Message-ID: X-Originating-IP: [70.50.100.93] X-Originating-Email: [pelletier_32@sympatico.ca] Received: from JP ([70.50.100.93]) by BAYC1-PASMTP02.BAYC1.HOTMAIL.COM over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Thu, 22 Sep 2005 15:27:56 -0700 Message-ID: <017301c5bfc4$f5e75180$6501a8c0@JP> From: "Jean-Pierre Pelletier" To: "John Arbash Meinel" Cc: References: <433326A6.8010708@arbash-meinel.com> <43332A24.8000809@arbash-meinel.com> Subject: Re: Queries 15 times slower on 8.1 beta 2 than on 8.0 Date: Thu, 22 Sep 2005 18:28:29 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-OriginalArrivalTime: 22 Sep 2005 22:27:57.0049 (UTC) FILETIME=[E1AACE90:01C5BFC4] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.521 required=5 tests=[AWL=0.005, FROM_ENDS_IN_NUMS=0.516, MSGID_FROM_MTA_HEADER=0] X-Spam-Level: X-Archive-Number: 200509/256 X-Sequence-Number: 14564 With enable-seq-scan = off, it runs in 350 ms so better than 484 ms but still much slower than 32 ms in 8.0.1. ============================================== Table "public.content" Column | Type | Modifiers ------------+---------+----------- contentid | integer | not null supplierid | integer | priceid | integer | Table "public.price" Column | Type | Modifiers -----------------------+--------------------------------+----------- priceid | integer | not null itemid | integer | supplierid | integer | locationid | smallint | fromdate | date | unitvalue | numeric | insertedbypersonid | integer | lastupdatedbypersonid | integer | inserttimestamp | timestamp(0) without time zone | lastupdatetimestamp | timestamp(0) without time zone | Indexes: "price_pkey" PRIMARY KEY, btree (priceid) Table "public.supplier" Column | Type | Modifie rs ---------------------+--------------------------------+------------------------- --------------------- supplierid | integer | not null default nextval ('SupplierId'::text) supplierdescription | character varying(50) | not null inserttimestamp | timestamp(0) without time zone | default now() approvaldate | date | Indexes: "Supplier Id" PRIMARY KEY, btree (supplierid) "Supplier Description" UNIQUE, btree (upper(supplierdescription::text)) "Supplier.InsertTimestamp" btree (inserttimestamp) Check constraints: "Supplier Name cannot be empty" CHECK (btrim(supplierdescription::text) <> ''::tex ================================================================================ Explan analyze with enable-seq-scan = off on 8.1 beta2 QUERY PLAN -------------------------------------------------------------------------------- ------------------------------------------------------------ Merge Left Join (cost=100000005.60..101607964.74 rows=1 width=0) (actual time= 729.067..729.078 rows=1 loops=1) Merge Cond: ("outer".priceid = "inner".priceid) -> Sort (cost=100000005.60..100000005.60 rows=1 width=4) (actual time=0.064 ..0.067 rows=1 loops=1) Sort Key: c.priceid -> Nested Loop Left Join (cost=100000000.00..100000005.59 rows=1 widt h=4) (actual time=0.038..0.049 rows=1 loops=1) -> Seq Scan on content c (cost=100000000.00..100000001.01 ro ws=1 width=8) (actual time=0.008..0.011 rows=1 loops=1) -> Index Scan using "Supplier Id" on supplier s (cost=0.00..4.5 6 rows=1 width=4) (actual time=0.016..0.019 rows=1 loops=1) Index Cond: ("outer".supplierid = s.supplierid) -> Index Scan using "Price Id" on price p (cost=0.00..1606505.44 rows=58147 5 width=4) (actual time=0.008..370.854 rows=164842 loops=1) Total runtime: 729.192 ms ----- Original Message ----- From: "John Arbash Meinel" To: "Jean-Pierre Pelletier" Cc: Sent: Thursday, September 22, 2005 6:03 PM Subject: Re: [PERFORM] Queries 15 times slower on 8.1 beta 2 than on 8.0