Re: Performance of ByteA: ascii vs binary

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Performance of ByteA: ascii vs binary
Date: 2019-03-21 12:35:36
Message-ID: 20190321123536.rrhnfudjws3h5xny@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.
> > >
> > > 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 is there something wrong with my benchmark?
> > >
> > > I used Python and psycopg2.
> >
> > I don't see this here (Debian 9, Python 3,5, psycopg2 2.7.6, PostgreSQL
> > 9.5).
> >
> > I modified my bench-bytea script (https://github.com/hjp/blob-bench) to
> > restrict the byte values to printable ASCII (32 .. 126). There was
> > absolutely no difference, as the attached graph shows.
>
> Strange. I saw a big difference.
> What did you test?
> I tested inserts.

The graph with the quantiles was for selects. For inserts I made only a
scatterplot and there didn't seem to be any difference either. I'll
check the quantiles, too, but I expect to see at most a small
difference. A large difference as the one you saw would show up clearly
in a scatterplot, too.

My test ist in github (see URL above). Do see the same difference with
my test on your system?

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp(at)hjp(dot)at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-03-21 13:49:33 Re: Performance of ByteA: ascii vs binary
Previous Message Gustavsson Mikael 2019-03-21 07:11:18 SV: to_timestamp function