Re: Trading off large objects (arrays, large strings, - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Trading off large objects (arrays, large strings,
Date
Msg-id Pine.LNX.4.44.0502151625470.3075-101000@kix.fsv.cvut.cz
Whole thread Raw
In response to Trading off large objects (arrays, large strings, large tables) for timeseries  (Antonios Christofides <anthony@itia.ntua.gr>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Alternate db location
Next
From: Marco Colombo
Date:
Subject: Re: Lost rows/data corruption?