Search Postgresql Archives

Re: Trading off large objects (arrays, large strings,

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, 

I did package for packing and unpacking large time series (in text format) 
into binary object. You can use it. Its very fast, storing 3 cols and 
90000 rows ~ 10sec(P160). 

testdb011=# select * FROM time_series_unpack(
testdb011(#   time_series_pack(
testdb011(#     '10.23, 10.21, 10.222'||chr(10)||
testdb011(#     '1.1, 2.5,3.10 '||chr(10)||
testdb011(#     '1.1, 1.2,1.5'),1);
 row |   f
-----+-------
   1 | 10.23
   2 |   1.1
   3 |   1.1
(3 rows)

testdb011=# select * FROM time_series_unpack(
testdb011(#   time_series_pack(
testdb011(#     '10.23, 10.21, 10.222'||chr(10)||
testdb011(#     '1.1, 2.5,3.10 '||chr(10)||
testdb011(#     '1.1, 1.2,1.5'),3);
 row |   f
-----+--------
   1 | 10.222
   2 |    3.1
   3 |    1.5
(3 rows)


testdb011=# select avg(f), min(f), max(f), count(f) from (
testdb011(#   select * FROM time_series_unpack(
testdb011(#     time_series_pack(
testdb011(#       '10.23, 10.21, 10.222'||chr(10)||
testdb011(#       '1.1,2.5,3.10 '||chr(10)||
testdb011(#       '1.1, 1.2, 1.5'),3)) d;
       avg        | min |  max   | count
------------------+-----+--------+-------
 4.94066667556763 | 1.5 | 10.222 |     3
(1 row)

Regards
Pavel Stehule


Attachment: ts.tar.gz
Description: GNU Zip compressed data

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux