Re: [EXTERNAL] Need help with performance tuning pg12 on linux

Поиск
Список
Период
Сортировка
От Matheus de Oliveira
Тема Re: [EXTERNAL] Need help with performance tuning pg12 on linux
Дата
Msg-id CAJghg4+6h4n2TXmsWROx98DcW_gAkRTe00WvtdDEXnXi4yDP7w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [EXTERNAL] Need help with performance tuning pg12 on linux  ("Wilson, Maria Louise (LARC-E301)[RSES]" <m.l.wilson@nasa.gov>)
Список pgsql-performance


On Wed, Dec 27, 2023 at 2:11 PM Wilson, Maria Louise (LARC-E301)[RSES] <m.l.wilson@nasa.gov> wrote:

Thanks for the reply!!  Having some issues due to nulls….  Any other thoughts?

 

i=# ALTER TABLE granule_file ADD PRIMARY KEY (granule_uuid, file_id);

ERROR:  column "granule_uuid" contains null values

 


Seems like an odd design for your table. Check if those rows with null value make any sense for your design.

In any case, for performance, you can try a plain index:

    CREATE INDEX ON granule_file (granule_uuid);

Since you are filtering for granule_uuid first, an index starting with this column seems to make more sense (that is why I made the PK starting with it before).

A composite index is not really necessary, but could help if you get an index-only scan, if you wanna try:

    CREATE INDEX ON granule_file (granule_uuid, file_id);

Best regards,
--
Matheus de Oliveira


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

Предыдущее
От: "Wilson, Maria Louise (LARC-E301)[RSES]"
Дата:
Сообщение: Re: [EXTERNAL] Need help with performance tuning pg12 on linux
Следующее
От: Matheus de Oliveira
Дата:
Сообщение: Re: [EXTERNAL] Need help with performance tuning pg12 on linux