| От | David Steele |
|---|---|
| Тема | Re: ANALYZE after CREATE TABLE AS SELECT... |
| Дата | |
| Msg-id | 54EFC5E7.9050002@pgmasters.net обсуждение исходный текст |
| Ответ на | Re: ANALYZE after CREATE TABLE AS SELECT... (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: ANALYZE after CREATE TABLE AS SELECT...
|
| Список | pgsql-general |
On 2/26/15 2:05 PM, Tom Lane wrote: > "Semyon Reyfman" <sreyfman@therealauthority.com> writes: >> When I create a table with "CREATE TABLE name AS SELECT." statement and >> immediately afterward use this new table in a query does it make sense to >> run ANALYZE on the new table in between? > > Yes. Yes. And to be more specific - vacuum cannot see tables that have been created in a transaction, so you should always analyze tables that you intend to read in the same transaction where you created them. Even if you do commit before reading there is a race condition with vacuum, so it's best to analyze. Bonus tip: the same is true for any temp tables you might create. More so, since vacuum will never see them at all. -- - David Steele david@pgmasters.net
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера