Re: BUG #2236: extremely slow to get unescaped bytea data
От | Michael Fuhr |
---|---|
Тема | Re: BUG #2236: extremely slow to get unescaped bytea data |
Дата | |
Msg-id | 20060208065839.GA18717@winnie.fuhr.org обсуждение исходный текст |
Ответ на | Re: BUG #2236: extremely slow to get unescaped bytea data (Kalador Tech Support <support@kalador.com>) |
Ответы |
Re: BUG #2236: extremely slow to get unescaped bytea data
|
Список | pgsql-bugs |
On Sat, Feb 04, 2006 at 04:06:11PM -0800, Kalador Tech Support wrote: > I've since isolated the problem to the unescape_bytea function not the > SELECT. > > I inserted the same image to a bytea column using base64 encoding, and > extracted it from the table (using base64 decoding) and this worked very > fast (<1 second). So, it is the unescape_bytea function that is to blame. pg_unescape_bytea is fast here; I just unescaped an 850K jpeg image in about 0.18 seconds on a slow (500MHz) machine. How did you determine that pg_unescape_bytea was the problem? What does something like the following show? $tstart = microtime(true); $data = pg_unescape_bytea(pg_fetch_result($res, 'data')); $dt = microtime(true) - $tstart; header("Content-Type: text/plain"); printf("unescape time = %.3fms, %d bytes\n", $dt * 1000.0, strlen($data)); -- Michael Fuhr
В списке pgsql-bugs по дате отправления: