Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 9443E16E34F8 for ; Sat, 17 Dec 2011 06:33:21 -0400 (AST) Received: from marvin.klingler.net ([91.212.121.244]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RbrZv-0005yD-Ve for pgsql-sql@postgresql.org; Sat, 17 Dec 2011 10:33:21 +0000 Received: from [10.0.60.1] (vpn.klingler.net [213.193.121.98]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by marvin.klingler.net (Postfix) with ESMTPSA id B98C633C78 for ; Sat, 17 Dec 2011 11:33:06 +0100 (CET) Date: Sat, 17 Dec 2011 11:33:06 +0100 From: Richard Klingler To: pgsql-sql@postgresql.org Message-ID: <20111217113306531983.1eb85a86@klingler.net> Subject: Natural sort order MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: GyazMail version 1.5.11 X-Pg-Spam-Score: -2.2 (--) X-Archive-Number: 201112/65 X-Sequence-Number: 36126 Morning... What is the fastest way to achieve natural ordering from queries? I found a function at: http://2kan.tumblr.com/post/361326656/postgres-natural-ordering But it increases the query time from around 0.4msecs to 74msecs... Might be not much if occasional queries are made..but I use it for building up a hierarchical tree menu in a web application where every msecs counts (o; cheers richard