pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedslow insert speeds with bytea
4+ messages / 4 participants
[nested] [flat]
* slow insert speeds with bytea
@ 2019-12-01 17:59 Alex O'Ree <alexoree@apache.org>
0 siblings, 3 replies; 4+ messages in thread
From: Alex O'Ree @ 2019-12-01 17:59 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Is there anything I can to increase insert speeds for bytea? Currently
running postgres 9.6.15
I have a few tables without a bytea and a few with bytea. There is a large
performance difference with inserts between the two. I'm inserting a byte[]
that's usually less than 1MB on content. The content itself is actually
just utf8 string data.
For the non-bytea table, inserts can be as high as 40k rows/sec, whereas
the bytea table is closer to 4k/sec or less.
If this is just a limitation of postgres, then that's fine but the
performance delta is so significant that i feel like i'm missing something
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: slow insert speeds with bytea
@ 2019-12-02 15:52 Adrian Klaver <adrian.klaver@aklaver.com>
parent: Alex O'Ree <alexoree@apache.org>
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Klaver @ 2019-12-02 15:52 UTC (permalink / raw)
To: Alex O'Ree <alexoree@apache.org>; pgsql-general@lists.postgresql.org
On 12/1/19 9:59 AM, Alex O'Ree wrote:
> Is there anything I can to increase insert speeds for bytea? Currently
> running postgres 9.6.15
>
> I have a few tables without a bytea and a few with bytea. There is a
> large performance difference with inserts between the two. I'm inserting
> a byte[] that's usually less than 1MB on content. The content itself is
> actually just utf8 string data.
>
> For the non-bytea table, inserts can be as high as 40k rows/sec, whereas
> the bytea table is closer to 4k/sec or less.
>
> If this is just a limitation of postgres, then that's fine but the
> performance delta is so significant that i feel like i'm missing something
It would help to have more information:
1) The schema of the table e.g. the output of \d in psql.
2) The actual INSERT query.
3) An EXPLAIN ANALYZE of the INSERT query.
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: slow insert speeds with bytea
@ 2019-12-02 16:01 Steve Atkins <steve@blighty.com>
parent: Alex O'Ree <alexoree@apache.org>
2 siblings, 0 replies; 4+ messages in thread
From: Steve Atkins @ 2019-12-02 16:01 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 01/12/2019 17:59, Alex O'Ree wrote:
> Is there anything I can to increase insert speeds for bytea? Currently
> running postgres 9.6.15
>
> I have a few tables without a bytea and a few with bytea. There is a
> large performance difference with inserts between the two. I'm
> inserting a byte[] that's usually less than 1MB on content. The
> content itself is actually just utf8 string data.
>
> For the non-bytea table, inserts can be as high as 40k rows/sec,
> whereas the bytea table is closer to 4k/sec or less.
4k 1MB rows/sec would be 4GB a second. It would need to be a fairly
decent IO system to manage that speed, let alone ten times that.
What's the typical row size of the tables with bytea fields vs the other
tables?
What are your IO stats during the two sorts of insert?
Cheers,
Steve
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: slow insert speeds with bytea
@ 2019-12-03 15:20 Jeff Janes <jeff.janes@gmail.com>
parent: Alex O'Ree <alexoree@apache.org>
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Janes @ 2019-12-03 15:20 UTC (permalink / raw)
To: Alex O'Ree <alexoree@apache.org>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>
On Mon, Dec 2, 2019 at 4:42 AM Alex O'Ree <alexoree@apache.org> wrote:
> Is there anything I can to increase insert speeds for bytea? Currently
> running postgres 9.6.15
>
> I have a few tables without a bytea and a few with bytea. There is a large
> performance difference with inserts between the two. I'm inserting a byte[]
> that's usually less than 1MB on content. The content itself is actually
> just utf8 string data.
>
> For the non-bytea table, inserts can be as high as 40k rows/sec, whereas
> the bytea table is closer to 4k/sec or less.
>
> If this is just a limitation of postgres, then that's fine but the
> performance delta is so significant that i feel like i'm missing something
>
That does seem pretty drastic. But I don't think we will get
anywhere unless you post your actual benchmarking program so that we can
try it for ourselves. I certainly don't see anything that drastic in my
own testing. Maybe the bottleneck is on the client side.
Cheers,
Jeff
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-12-03 15:20 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01 17:59 slow insert speeds with bytea Alex O'Ree <alexoree@apache.org>
2019-12-02 15:52 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-12-02 16:01 ` Steve Atkins <steve@blighty.com>
2019-12-03 15:20 ` Jeff Janes <jeff.janes@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox