Re: SUBSTRING performance for large BYTEA - Mailing list pgsql-general

From Tom Lane
Subject Re: SUBSTRING performance for large BYTEA
Date
Msg-id 12895.1187454042@sss.pgh.pa.us
Whole thread Raw
In response to SUBSTRING performance for large BYTEA  ("Vance Maverick" <vmaverick@pgp.com>)
Responses Re: SUBSTRING performance for large BYTEA  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: SUBSTRING performance for large BYTEA  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general
"Vance Maverick" <vmaverick@pgp.com> writes:
> My question is about performance in the postgres server.  When I execute
> "SELECT SUBSTRING (my_bytea FROM ? FOR ?) FROM my_table WHERE id =3D ?",
> does it fetch the whole BYTEA into memory?  Or does it access only the
> pages that contain the requested substring?

Recent releases will do what you want if the column has been marked
SET STORAGE EXTERNAL (before storing anything in it...)  See the
ALTER TABLE reference page.

            regards, tom lane

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Writing most code in Stored Procedures
Next
From: Ron Johnson
Date:
Subject: Re: Writing most code in Stored Procedures