Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id A81B52E0056 for ; Wed, 7 May 2008 13:28:16 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93247-09 for ; Wed, 7 May 2008 13:28:06 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by developer.postgresql.org (Postfix) with ESMTP id C13702E0042 for ; Wed, 7 May 2008 13:28:05 -0300 (ADT) Received: by fg-out-1718.google.com with SMTP id 16so404918fgg.23 for ; Wed, 07 May 2008 09:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=hwRg4s0agt46AwuA9aRN7v3xuivGYngYZH44WeYAyMk=; b=V27hRklPDjEbJj6kItHlI7i5akmWC/LRKj5RlHyH771ajOIu06CFqT9aoI017WdYhbE1p2+4N3yvvOapLAXfQIRjChq+FW6GmEyGryuQDx7Xj0X4GirOpo7zpsivO6xSKAGcewoOAWNOOoKLG7E0hLb6QZAmRVFboTv8y3lJS+Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=cWx+W54JS4vy9KOOFhBQ9j51rcaTpsty77kWfxH3Z0okZZz/Ci779f46o7k20NhoCJun5dtRXQMNVafrXsTUb5R3tSveo1cQZtyPnRnGEZ4sM2z0PAnHRDd2jAjs/XrzrWpUSxZV5f/2qdxki47TnldLJccAAnwlIJrhsU7GSr0= Received: by 10.86.73.7 with SMTP id v7mr4175145fga.37.1210177684660; Wed, 07 May 2008 09:28:04 -0700 (PDT) Received: by 10.86.36.10 with HTTP; Wed, 7 May 2008 09:28:04 -0700 (PDT) Message-ID: <461a87490805070928h14226615hb87bf2574e26f330@mail.gmail.com> Date: Wed, 7 May 2008 13:28:04 -0300 From: "Tarcizio Bini" To: pgsql-performance@postgresql.org Subject: =?WINDOWS-1252?Q?Query_Optimization_with_Kruskal=92s_Algorithm?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2522_19068819.1210177684648" X-Google-Sender-Auth: 07cde6c2d32f91f1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200805/121 X-Sequence-Number: 30089 ------=_Part_2522_19068819.1210177684648 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello friends, I'm working on optimizing queries using the Kruskal algorithm ( http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4318118). I did several tests in the database itself and saw interesting results. I did 10 executions with each query using unchanged source of Postgres and then adapted to the algorithm of Kruskal. The query I used is composed of 12 tables and 11 joins. Results Postgresql unchanged (ms): (\ timing) 170,690 168,214 182,832 166,172 174,466 167,143 167,287 172,891 170,452 165,665 average=> 170,5812 ms Results of Postgresql with the Kruskal algorithm (ms): (\ timing) 520,590 13,533 8,410 5,162 5,543 4,999 9,871 4,984 5,010 8,883 average=> 58,6985 ms As you can see the result, using the Kruskal algorithm, the first query takes more time to return results. This does not occur when using the original source of Postgres. So how is the best method to conduct the tests? I take into consideration the average of 10 executions or just the first one? Do you think I must clean the cache after each query? (because the other (9) executions may have information in memory). regards, Tarcizio Bini. ------=_Part_2522_19068819.1210177684648 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello friends,

I'm working on optimizing queries using the Kruskal algorithm (http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4318118). I did several tests in the database itself and saw interesting results.
I did 10 executions with each query using unchanged source of Postgres and then adapted to the algorithm of Kruskal.
The query I used is composed of 12 tables and 11 joins.

Results Postgresql unchanged (ms): (\ timing)

170,690
168,214
182,832
166,172
174,466
167,143
167,287
172,891
170,452
165,665
average=> 170,5812 ms


Results of Postgresql with the Kruskal algorithm (ms): (\ timing)

520,590
13,533
8,410
5,162
5,543
4,999
9,871
4,984
5,010
8,883
average=> 58,6985 ms


As you can see the result, using the Kruskal algorithm, the first query takes more time to return results. This does not occur when using the original source of Postgres.
So how is the best method to conduct the tests? I take into consideration the average of 10 executions or just the first one?
Do you think I must clean the cache after each query? (because the other (9) executions may have information in memory).

regards, Tarcizio Bini.
------=_Part_2522_19068819.1210177684648--