Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0RGLTq61274; Sat, 27 Jan 2001 11:21:29 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f0RGKq921891; Sat, 27 Jan 2001 11:20:52 -0500 (EST) To: Kovacs Zoltan cc: pgsql-hackers@postgresql.org, pgsql-sql@postgresql.org Subject: Re: wrong query plan in 7.1beta3 In-reply-to: References: Comments: In-reply-to Kovacs Zoltan message dated "Sat, 27 Jan 2001 15:05:45 +0100" Date: Sat, 27 Jan 2001 11:20:52 -0500 Message-ID: <21888.980612452@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/1199 X-Sequence-Number: 3957 Kovacs Zoltan writes: > There seems to be an optimizer problem in 7.1beta3. The query you can see > below worked fast in 7.0.2 but in 7.1beta3 is rather slow. The problem is > that an 'index scan' has been changed to a 'seq scan'. Details: This is fixed in current sources: I get Subquery Scan sd_user_grant (cost=5.16..5.22 rows=1 width=61) -> Aggregate (cost=5.16..5.22 rows=1 width=61) -> Group (cost=5.16..5.18 rows=3 width=61) -> Sort (cost=5.16..5.16 rows=3 width=61) -> Nested Loop (cost=0.00..5.14 rows=3 width=61) -> Seq Scan on pg_shadow (cost=0.00..1.01 rows=1 width=32) -> Index Scan using sd_grant_pkey on sd_grant (cost=0.00..4.07 rows=3 width=29) regards, tom lane