Unix Technical Forum

get_rel_* functions in lsyscache.c

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 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 04:34 AM
Jaime Casanova
 
Posts: n/a
Default get_rel_* functions in lsyscache.c

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 04:34 AM
Tom Lane
 
Posts: n/a
Default Re: get_rel_* functions in lsyscache.c

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:12 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com