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 B53DE5331C for ; Fri, 13 May 2005 15:35:56 -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 96026-08 for ; Fri, 13 May 2005 18:35:51 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id 7DFCA5339C for ; Fri, 13 May 2005 15:35:47 -0300 (ADT) Received: from tschibtschibojtschitsch (dsl-082-082-199-114.arcor-ip.net [82.82.199.114]) (authenticated) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id j4DIZdv20047; Fri, 13 May 2005 20:35:39 +0200 Subject: Re: Bad plan after vacuum analyze From: Markus Bertheau To: Guillaume Smet Cc: Tom Lane , josh@agliodbs.com, pgsql-performance@postgresql.org In-Reply-To: <4282723C.5080903@smet.org> References: <42823F94.8050009@smet.org> <200505111110.15983.josh@agliodbs.com> <13964.1115837926@sss.pgh.pa.us> <42825DBB.7000703@smet.org> <14301.1115840296@sss.pgh.pa.us> <4282638E.2020307@smet.org> <17017.1115843555@sss.pgh.pa.us> <4282723C.5080903@smet.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-tuFi4bR4cl1+vr6p9K4h" Date: Fri, 13 May 2005 20:35:35 +0200 Message-Id: <1116009335.7327.0.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.102 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/269 X-Sequence-Number: 12433 --=-tuFi4bR4cl1+vr6p9K4h Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =D0=92 =D0=A1=D1=80=D0=B4, 11/05/2005 =D0=B2 22:59 +0200, Guillaume Smet = =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Anyway, I tried to work on the statistics as you told me and here are=20 > the results: > ccm_perf=3D# ALTER TABLE acs_objects ALTER COLUMN object_id SET STATISTIC= S 30; > ALTER TABLE > ccm_perf=3D# ANALYZE acs_objects; > ANALYZE >=20 > ccm_perf=3D# \i query_section.sql > ... correct plan ... > Total runtime: 0.555 ms Given Tom's analysis, how can increasing the stats target change which plan is chosen? --=20 Markus Bertheau --=-tuFi4bR4cl1+vr6p9K4h Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBChPN22RUnMPztcykRAna1AJ9xA1Ag6Q+n0bTXQ+RG+LkE4u2WKQCfR13I GQXdW/oiKk8FpS2l0k8mvB0= =PC0S -----END PGP SIGNATURE----- --=-tuFi4bR4cl1+vr6p9K4h--