| От | Tom Lane |
|---|---|
| Тема | Re: get_rel_* functions in lsyscache.c |
| Дата | |
| Msg-id | 21246.1119710402@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | get_rel_* functions in lsyscache.c (Jaime Casanova <systemguards@gmail.com>) |
| Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера