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 CDF5F3A509B for ; Thu, 13 Jan 2005 08:34:38 +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 92187-06 for ; Thu, 13 Jan 2005 08:34:34 +0000 (GMT) Received: from ew.mimos.my (ew.mimos.my [192.228.129.34]) by svr1.postgresql.org (Postfix) with ESMTP id 3E6F93A4F5D for ; Thu, 13 Jan 2005 08:34:34 +0000 (GMT) Received: from mimos.my (mcg189.nat.mimos.my [10.1.18.189]) by ew.mimos.my (8.12.9p2/8.12.9) with ESMTP id j0D8YVsP024332 for ; Thu, 13 Jan 2005 16:34:32 +0800 (MYT) (envelope-from hasnulfadhly.h@mimos.my) Message-ID: <41E63294.9040605@mimos.my> Date: Thu, 13 Jan 2005 16:34:28 +0800 From: Hasnul Fadhly bin Hasan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Performance delay Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.065 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/162 X-Sequence-Number: 9852 Hi, just want to share with all of you a wierd thing that i found when i tested it. i was doing a query that will call a function long2ip to convert bigint to ips. so the query looks something like this. select id, long2ip(srcip), long2ip(dstip) from sometable where timestamp between timestamp '01-10-2005' and timestamp '01-10-2005 23:59' order by id limit 30; for your info, there are about 300k rows for that timeframe. it cost me about 57+ secs to get the list. which is about the same if i query select id, long2ip(srcip), long2ip(dstip) from sometable where timestamp between timestamp '01-10-2005' and timestamp '01-10-2005 23:59' it will cost me about 57+ secs also. Now if i did this select id,long2ip(srcip), long2ip(dstip) from ( * from sometable where timestamp between timestamp '01-10-2005' and timestamp '01-10-2005 23:59' order by id limit 30) as t; it will cost me about 3+ secs Anyone knows why this is the case? Hasnul