Re: Hierarchical numeric data type - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: Hierarchical numeric data type
Date
Msg-id CAL_0b1s=m8P7USEr6Bxjfr3WNxF=54USC-A-xwYnEwT+G0hR7w@mail.gmail.com
Whole thread Raw
In response to Hierarchical numeric data type  (Derek Poon <derekp+pgsql@ece.ubc.ca>)
Responses Re: Hierarchical numeric data type
List pgsql-general
On Tue, Aug 6, 2013 at 2:36 PM, Derek Poon <derekp+pgsql@ece.ubc.ca> wrote:
> The performance impact of the enhanced comparator would probably be negligible, compared to I/O bottlenecks.  A
biggerissue would be backwards compatibility, especially for ltrees with existing btree indexes. 
>
> Feedback?  Suggestions?

Use integer arrays. It works just like you need

select array_to_string(c, '.')
from (values (array[1,10,2]), (array[1,5,3])) as sq(c)
order by c;

 array_to_string
-----------------
 1.5.3
 1.10.2

and it is pretty fast when indexed.

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

Profile: http://www.linkedin.com/in/grayhemp
Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979
Skype: gray-hemp
Jabber: gray.ru@gmail.com


pgsql-general by date:

Previous
From: Sergey Konoplev
Date:
Subject: Re: Exit code -1073741819
Next
From: liuyuanyuan
Date:
Subject: Re: inserting huge file into bytea cause out of memory