Search Postgresql Archives

Re: Trouble with bytea in SPI...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 02, 2005 at 12:17:09PM -0600, Cristian Prieto wrote:

Hey Cristian,

> Right now it works just with one field and I guess it is working well, but 
> I am very worried about the performance of SPI_execute() and SPI_execp(). I 
> read in the Developer FAQ something about accessing the data directly from 
> the backend code. If it is like this I would like to get more infor about 
> how to use SearchSysCache() and heap_beginscan().
> 
> Do you think I need to implement such thing to improve performance? any 
> idea in how to improve my approach to this trouble?

While SPI does impose some overhead, code-wise it is certainly
appropiate for what you are doing.  SearchSysCache() and the like is
reserved for system catalogs, and I don't think you want to recompile
the whole of Postgres just to get some improvement there.  No need to
mention the fact that your Postgres would be incompatible with everyone
else's, and un-backup-able.  Certainly not a road I'd go.

Using heap_beginscan et al would be almost the same as using SPI.  I
doubt there's a lot of performance to be gained that way ... or maybe
there is, but you'd pay in maintenability and obscure bugs, and you'll
lose the future improvements to the optimizer, etc.

Just be sure to use VACUUM and ANALYZE appropiately, keep well defined
indexes, and you shouldn't need much else.

-- 
Alvaro Herrera -- Valdivia, Chile         Architect, www.EnterpriseDB.com
"The important things in the world are problems with society that we don't
understand at all. The machines will become more complicated but they won't
be more complicated than the societies that run them."    (Freeman Dyson)

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux