why does reindex invalidate relcache without modifying system tables

Поиск
Список
Период
Сортировка
От wenjing zeng
Тема why does reindex invalidate relcache without modifying system tables
Дата
Msg-id 5F38F5EA-2565-419F-A93C-7E31AFB1628E@gmail.com
обсуждение исходный текст
Ответы Re: why does reindex invalidate relcache without modifying system tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi Tom

I would like to ask you about the details of index build.
I found that in the index_update_stats function, i.e. the CREATE INDEX/REINDEX/Truncate INDEX process,
relchche is invalidated whether the index information is updated. I want to know why you're did this
The code is:
        if (dirty)
         {
            heap_inplace_update(pg_class, tuple);
            /* the above sends a cache inval message */ }
        else
        {
             /* no need to change tuple, but force relcache inval anyway */
             CacheInvalidateRelcacheByTuple(tuple);
        }

There's a special line of comment here, and I think you wrote that part for some reason.

The reason I ask this question is that
1 similar places like the vac_update_relstats /vac_update_datfrozenxid function don't do this.
2 Local Temp table with ON COMMIT DELETE ROWS builds index for each transaction commit.
This causes relcache of the temp table to be rebuilt over and over again.

Looking forward to your reply.

Thanks


Wenjing





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Add Boolean node
Следующее
От: Sascha Kuhl
Дата:
Сообщение: Re: Add Boolean node