Search Postgresql Archives

OID Usage

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

 



Hi ...

I am using postgresql 7.4 on a pontencial large DB system, and I am quite happy of the performance of this database, as for now. Only one thing worrys me, and I like to get some pease to my mind about this.

I use normal tabel ID (SERIAL and BIGSERIAL) all over the place for FK constaints, but I use OID in one special situation. When I insert a single row into a table, I like my low level code to be kompatible with mysql ( mysql_insert_id ), and fetch the row that I just inserted. This I do by using the PGoidValue function, and then select the row by the oid. This works quite nice .... but when a table get large, it become a big search (seq scan) so I have added an index on oid's on the table where I use this trick, and this have helper :-)

This is the ONLY use I have for the oid's, and I don't use them for anything else !

Now, are there any danger in using this method ? And if there is, how can I do this trick without knowing the layout of the table I insert into ?

Regards

/BL


---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?

http://archives.postgresql.org

[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