Re: [SQL] Natural sort order

2012-02-29 Thread Richard Klingler
Actually got it figured...for some reason it had the function twice (o; But with or without function index the time to query stays the same...around 110msec for 24 results... cheers richard On Wed, 29 Feb 2012 11:08:46 -0500, Tom Lane wrote: > Richard Klingler writes: >> Took some t

Re: [SQL] Natural sort order

2012-02-28 Thread Richard Klingler
a > functional index on this expression. > > CREATE INDEX mytable_column_btrsort_idx ON mytable( btrsort(column) ); > > this can help. > > > > > > 2011/12/17 Richard Klingler : >> Morning... >> >> What is the fastest way to achieve natural ord

[SQL] Natural sort order

2011-12-17 Thread Richard Klingler
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 f

Re: [SQL] conditional FROM

2011-12-10 Thread Richard Klingler
%' ; Though I just can't order the rows anymore by inet(arp.ip) anymore... Any hints on my ordering isn't anylonger possible? But at least the query is way faster than before (o; 2msec instead of 650msecs (o; thanx ina dvance richard On Sat, 10 Dec 2011 11:28:29 -0500, David Jo

[SQL] conditional FROM

2011-12-10 Thread Richard Klingler
Good day... I'm trying to build a query for PGSQL 9.1 where a table has two references with only one being used depending of the type of entry.. For example, the table has following simplified structure: portid primary key port2node index to table node por