Re: Refresh Materialized View Issue

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Refresh Materialized View Issue
Дата
Msg-id CANzqJaCOFt4tsv=uYn+LtYbx4nFB+k1Mig7CdVONKzU8gM8oCg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Refresh Materialized View Issue  (Jeremiah Bauer <jbauer@agristats.com>)
Ответы Re: Refresh Materialized View Issue
Список pgsql-general
On Thu, Jan 11, 2024 at 3:50 PM Jeremiah Bauer <jbauer@agristats.com> wrote:
My question is: what indexes are on public.large_table?  Hopefully there's a compound b-tree index on id1, id2, id3.
There is not, after further investigation.  There are these 4 indexes that involve id1, id2, and id3.  Should I try creating an index on all three of the columns?

CREATE INDEX IF NOT EXISTS idx_large_table_id1
[snip] 
CREATE INDEX IF NOT EXISTS idx_large_table_id2
[snip]
CREATE INDEX IF NOT EXISTS idx_large_table_id3
[snip] 
CREATE INDEX IF NOT EXISTS idx_large_table_id2_id3
[snip]
 
I'd strongly think about creating such an index, since the current indices don't help much.

Adding id1 to the end of idx_large_table_id2_id3 might be a better option, since it'll reuse much of the existing disk space.
 
A materialized view isn't too different from an unlogged table. 
So an unlogged table would also be an appropriate solution?

Sure, since materialized views are effectively tables with a SELECT statement bound to it, and are logged.  Thus, unlogged tables are faster to create.  Of course, being unlogged is a two-edged sword: any unclean shutdown makes the data go away; you'd have to rebuild the table.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Time zone offset in to_char()
Следующее
От: Michael Nolan
Дата:
Сообщение: undefined symbol when installing pgcrypto on 16.1