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 511A7B4388B for ; Mon, 7 Jul 2003 13:59:14 +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 82777-03 for ; Mon, 7 Jul 2003 10:58:59 -0300 (ADT) Received: from mars.eurovox.fr (unknown [195.68.105.194]) by svr1.postgresql.org (Postfix) with ESMTP id 441DDB43376 for ; Mon, 7 Jul 2003 10:58:59 -0300 (ADT) Received: from 127.0.0.1 (localhost.localdomain [127.0.0.1]) by dummy.domain.name (Postfix) with SMTP id 695EB24EDBD for ; Mon, 7 Jul 2003 15:59:03 +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 0B4CA24EDB7 for ; Mon, 7 Jul 2003 15:59:03 +0200 (CEST) From: JEANARTHUR@EUROVOX.FR To: Date: Mon, 07 Jul 2003 15:58:57 +0200 MIME-Version: 1.0 Subject: Explain Message-ID: <3F0998C1.11276.1652504@localhost> In-reply-to: <3F09578C.19508.669C3F@localhost> References: <000e01c34366$9bcacbf0$10d4a8c0@mm.eutelsat.org> 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/66 X-Sequence-Number: 9407 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. 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 ? Jean-Arthur Silve EuroVox 4, Place F=E9lix Ebou=E9 75583 Paris Cedex 12 T : +33 1 44670505 F : +33 1 44670519