This is a discussion on get_rel_* functions in lsyscache.c within the pgsql Hackers forums, part of the PostgreSQL category; --> Hi, i have a doubt... it seems to me that the get_rel_* functions in lsyscache do the same as ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, i have a doubt... it seems to me that the get_rel_* functions in lsyscache do the same as doing heap_open(); Calling the appropiate macro Relation* heap_close(); is there any difference between them? in wich situation is one better than the other? -- regards, Jaime Casanova (DBA: DataBase Aniquilator ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match |
| ||||
| Jaime Casanova <systemguards@gmail.com> writes: > Hi, i have a doubt... > it seems to me that the get_rel_* functions in lsyscache do the same as doing > heap_open(); > Calling the appropiate macro Relation* > heap_close(); > is there any difference between them? in wich situation is one better > than the other? The lsyscache functions are just notational convenience --- they're shorter to write and easier to read than accessing the underlying catalog entries for yourself. However, I'd usually only use them to pull one or two items from a given catalog entries; if I need several fields from the same catalog entry, I'd open the catalog entry just once and grab the fields directly, to avoid multiple cache searches. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match |