Re: Performance of ByteA: ascii vs binary

2019-04-10 Thread Олег Самойлов
Just theoretically assumption. PostgreSQL sometimes may optimise internal format of data and can sometimes zip data. ASCII data can be zipped better, then binary random data. Also PostgreSQL sometimes take decision to keep a column in an external file, if the column is still too big after zip. I

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Peter J. Holzer
On 2019-03-22 13:40:28 +0100, Francisco Olarte wrote: > On Fri, Mar 22, 2019 at 11:22 AM Thomas Güttler > wrote: > > Thank you for asking several times for a benchmark. > > I wrote it now and it is visible: inserting random bytes into bytea > > is much slower, if you use the psycopg2 defaults. > >

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Francisco Olarte
Thomas: On Fri, Mar 22, 2019 at 2:03 PM Thomas Güttler wrote: > > I'm not too sure, but I read ( in the code ) you are measuring a > > nearly not compressible urandom data againtst a highly compressible ( ... > for this case toast-tables/wal is a detail of the implementation. > This tests does no

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Adrian Klaver
On 3/22/19 6:04 AM, Thomas Güttler wrote: Am 22.03.19 um 13:40 schrieb Francisco Olarte: Thomas: On Fri, Mar 22, 2019 at 11:22 AM Thomas Güttler wrote: Thank you for asking several times for a benchmark. I wrote it now and it is visible: inserting random bytes into bytea is much slower, i

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Thomas Güttler
Am 22.03.19 um 13:40 schrieb Francisco Olarte: Thomas: On Fri, Mar 22, 2019 at 11:22 AM Thomas Güttler wrote: Thank you for asking several times for a benchmark. I wrote it now and it is visible: inserting random bytes into bytea is much slower, if you use the psycopg2 defaults. Here is th

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Kenneth Marshall
On Fri, Mar 22, 2019 at 01:40:28PM +0100, Francisco Olarte wrote: > Thomas: > > On Fri, Mar 22, 2019 at 11:22 AM Thomas Güttler > wrote: > > Thank you for asking several times for a benchmark. > > I wrote it now and it is visible: inserting random bytes into bytea is much > > slower, > > if you

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Francisco Olarte
Thomas: On Fri, Mar 22, 2019 at 11:22 AM Thomas Güttler wrote: > Thank you for asking several times for a benchmark. > I wrote it now and it is visible: inserting random bytes into bytea is much > slower, > if you use the psycopg2 defaults. > Here is the chart: > > https://github.com/guettli

Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Thomas Güttler
Thank you for asking several times for a benchmark. I wrote it now and it is visible: inserting random bytes into bytea is much slower, if you use the psycopg2 defaults. Here is the chart: https://github.com/guettli/misc/blob/master/bench-bytea-inserts-postrgres.png And here is the script wh

Re: Performance of ByteA: ascii vs binary

2019-03-21 Thread Adrian Klaver
On 3/21/19 6:49 AM, Tom Lane wrote: "Peter J. Holzer" writes: On 2019-03-20 13:20:57 +0100, Thomas Güttler wrote: Strange. I saw a big difference. What did you test? I tested inserts. The graph with the quantiles was for selects. Hmm, so there are two different code paths being considered

Re: Performance of ByteA: ascii vs binary

2019-03-21 Thread Tom Lane
"Peter J. Holzer" writes: > On 2019-03-20 13:20:57 +0100, Thomas Güttler wrote: >> Strange. I saw a big difference. >> What did you test? >> I tested inserts. > The graph with the quantiles was for selects. Hmm, so there are two different code paths being considered here -- the OP is apparently

Re: Performance of ByteA: ascii vs binary

2019-03-21 Thread Peter J. Holzer
On 2019-03-20 13:20:57 +0100, Thomas Güttler wrote: > > > Am 19.03.19 um 20:37 schrieb Peter J. Holzer: > > On 2019-03-18 15:33:17 +0100, Thomas Güttler wrote: > > > I did some benchmarking and in my setup there was major > > > performance difference. > > > > > > I tested a ByteA column. > > >

Re: Performance of ByteA: ascii vs binary

2019-03-20 Thread Thomas Güttler
Am 19.03.19 um 20:37 schrieb Peter J. Holzer: On 2019-03-18 15:33:17 +0100, Thomas Güttler wrote: I did some benchmarking and in my setup there was major performance difference. I tested a ByteA column. If I used ascii data the tests took 52 seconds. If I used random binary data the test to

Re: Performance of ByteA: ascii vs binary

2019-03-19 Thread Peter J. Holzer
On 2019-03-18 15:33:17 +0100, Thomas Güttler wrote: > I did some benchmarking and in my setup there was major > performance difference. > > I tested a ByteA column. > > If I used ascii data the tests took 52 seconds. > If I used random binary data the test took 250 seconds. > > binary data is (r

Re: minio server. Was: Performance of ByteA: ascii vs binary

2019-03-19 Thread Thomas Güttler
Am 18.03.19 um 17:52 schrieb Adrian Klaver: On 3/18/19 7:59 AM, Thomas Güttler wrote: Am 18.03.19 um 15:49 schrieb Tom Lane: Adrian Klaver writes: On 3/18/19 7:33 AM, Thomas Güttler wrote: If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 sec

Re: minio server. Was: Performance of ByteA: ascii vs binary

2019-03-18 Thread Adrian Klaver
On 3/18/19 7:59 AM, Thomas Güttler wrote: Am 18.03.19 um 15:49 schrieb Tom Lane: Adrian Klaver writes: On 3/18/19 7:33 AM, Thomas Güttler wrote: If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. This doesn't seem terribly surprising in

minio server. Was: Performance of ByteA: ascii vs binary

2019-03-18 Thread Thomas Güttler
Am 18.03.19 um 15:49 schrieb Tom Lane: Adrian Klaver writes: On 3/18/19 7:33 AM, Thomas Güttler wrote: If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. This doesn't seem terribly surprising in bytea_output = escape mode. Probably wit

Re: Performance of ByteA: ascii vs binary

2019-03-18 Thread Tom Lane
Adrian Klaver writes: > On 3/18/19 7:33 AM, Thomas Güttler wrote: >> If I used ascii data the tests took 52 seconds. >> If I used random binary data the test took 250 seconds. This doesn't seem terribly surprising in bytea_output = escape mode. Probably with bytea_output = hex the performance wo

Re: Performance of ByteA: ascii vs binary

2019-03-18 Thread Adrian Klaver
On 3/18/19 7:33 AM, Thomas Güttler wrote: I did some benchmarking and in my setup there was major performance difference. I tested a ByteA column. What was the test? If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. binary data is (roug

Performance of ByteA: ascii vs binary

2019-03-18 Thread Thomas Güttler
I did some benchmarking and in my setup there was major performance difference. I tested a ByteA column. If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. binary data is (roughly) five times slower than ascii data? Is this a know fact, or i