X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E360F3A592F for ; Wed, 26 Jan 2005 21:43:19 +0000 (GMT) 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 61039-05 for ; Wed, 26 Jan 2005 21:43:15 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 556A23A592A for ; Wed, 26 Jan 2005 21:43:16 +0000 (GMT) Received: (qmail 19847 invoked from network); 26 Jan 2005 22:43:33 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 26 Jan 2005 22:43:33 +0100 To: tjo@acm.org, pgsql-sql@postgresql.org Subject: Re: testing/predicting optimization using indexes References: <41F1A387.5040402@acm.org> Message-ID: Date: Wed, 26 Jan 2005 22:45:19 +0100 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <41F1A387.5040402@acm.org> User-Agent: Opera M2/7.54 (Linux, build 751) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/273 X-Sequence-Number: 20061 > I'm quite happy with the speedup in 3, but puzzled over the slowdown in > 2. Could you provide : - SELECT count(*) FROM structure; => NRows - SELECT avg(length(smiles)) FROM structure; Then VACUUM FULL ANALYZE structure Redo your timings and this time post EXPLAIN ANALYZE Also your query returns 1313 rows, so wan you post : EXPLAIN ANALYZE SELECT oe_matches(smiles,'c1ccccc1CC(=O)NC') FROM structure; => time T1 EXPLAIN ANALYZE SELECT smiles FROM structure; => time T2 (T1-T2)/(NRows) will give you an estimate of the time spent in each oe_matches call. Also note that for postgres (a,b) > (c,d) means ((a>c) and (b>d)), which can be misleading, but I think that's what you wanted.