Re: Very slow bytea extraction - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Very slow bytea extraction
Date
Msg-id 22731.1174518062@sss.pgh.pa.us
Whole thread Raw
In response to Very slow bytea extraction  ("msmbarabino@virgilio.it" <msmbarabino@virgilio.it>)
List pgsql-bugs
"msmbarabino@virgilio.it" <msmbarabino@virgilio.it> writes:
> The test table has 36 records and each bytea field
> contains a 250KB object. A (SELECT byteafield FROM table) takes more
> than 1 minute to execute.

Hm, it takes about 4 seconds here, on a fairly old and slow machine:

$ time psql -A -c "select * from file" regression | wc
38 33699 26653873

real    0m4.00s
user    0m1.37s
sys     0m0.62s

In psql the trick is to use unaligned display mode, else psql itself
eats a whole lot of time trying to nicely format those 250KB rows:

$ time psql  -c "select * from file" regression | wc
40 33700 28134681

real    0m57.10s
user    0m53.55s
sys     0m0.67s

I surmise that your problem is likewise on the client side, but you
weren't very specific about what client code you were using.  Look
for bottlenecks associated with processing of very wide rows...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [cstdenis@ctgameinfo.com: Re: BUG #3179: crash when canceling avacuum]
Next
From: TANIDA Yutaka
Date:
Subject: "Relation not found" error but table exits.