X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 0124DB4316A for ; Mon, 7 Jul 2003 15:55:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 35373-08 for ; Mon, 7 Jul 2003 12:55:28 -0300 (ADT) Received: from mars.eurovox.fr (unknown [195.68.105.194]) by svr1.postgresql.org (Postfix) with ESMTP id AA0D9B435BB for ; Mon, 7 Jul 2003 12:55:27 -0300 (ADT) Received: from 127.0.0.1 (localhost.localdomain [127.0.0.1]) by dummy.domain.name (Postfix) with SMTP id 4622424EDCB; Mon, 7 Jul 2003 17:55:27 +0200 (CEST) Received: from JA (host.161.115.68.195.rev.coltfrance.com [195.68.115.161]) by mars.eurovox.fr (Postfix) with ESMTP id 700B424EDBD; Mon, 7 Jul 2003 17:55:26 +0200 (CEST) From: JEANARTHUR@EUROVOX.FR To: Stephan Szabo , Date: Mon, 07 Jul 2003 17:55:25 +0200 MIME-Version: 1.0 Subject: Re: Explain Message-ID: <3F09B40D.8440.1CFADC8@localhost> References: <3F0998C1.11276.1652504@localhost> In-reply-to: <20030707084355.E76534-100000@megazone23.bigpanda.com> X-mailer: Pegasus Mail for Windows (v4.02) Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: Quoted-printable Content-description: Mail message body X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/71 X-Sequence-Number: 9412 Thanks for your answer ! Yes, I set up enable_seqscan =3D off ! Thanks ! On 7 Jul 2003 at 8:46, Stephan Szabo wrote: > > On Mon, 7 Jul 2003 JEANARTHUR@EUROVOX.FR wrote: > > > Hi, > > > > when I do an explain on a certain query, I have this answer : > > > > > > QUERY PLAN > > -----------------------------------------------------------------------= --------------- > > Aggregate (cost=3D100017927.48..100017927.48 rows=3D1 width=3D8) > > -> Seq Scan on stats_daily_2003 > > (cost=3D100000000.00..100017927.47 rows=3D1 width=3D8) > > Filter: ((id_compte =3D 29075) AND (periode =3D '07-07-2003'::= date)) > > (3 rows) > > > > > > Well, I don"t really undestand the meaning of > > > > cost=3D100000000.00..100017927.47 > > > > and > > > > cost=3D100017927.48..100017927.48 > > > > I guess this result is relatively bad. > > This probably actually implies that you've done something like set > enable_seqscan=3Doff at some point which makes the costs of seqscans very= high > to discourage them. In any case, this plan is still expected to be much > more expensive than the below even when not taking that into account. You > may also want to do explain analyze to get real world numbers rather than > just the estimates. > > > The same query on a similar table but with an index give : > > QUERY PLAN > > -----------------------------------------------------------------------= --------------------- > > ---------------- > > Aggregate (cost=3D9.60..9.60 rows=3D1 width=3D8) > > -> Index Scan using ap_stats_daily_2003_save on > > stats_daily_2003_save (cost=3D0.00..9.59 rows=3D2 width=3D8) > > Index Cond: ((periode =3D '07-07-2003'::date) AND (id_compte = =3D > > 29075)) > > (3 rows) > > > > Could you confirm me the second explain is "better" than the first one > > ? > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster Jean-Arthur Silve EuroVox 4, Place F=E9lix Ebou=E9 75583 Paris Cedex 12 T : +33 1 44670505 F : +33 1 44670519