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