From: | Matheus de Oliveira <matioli(dot)matheus(at)gmail(dot)com> |
---|---|
To: | "Wilson, Maria Louise (LARC-E301)[RSES]" <m(dot)l(dot)wilson(at)nasa(dot)gov> |
Cc: | Frits Hoogland <frits(dot)hoogland(at)gmail(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org> |
Subject: | Re: [EXTERNAL] Need help with performance tuning pg12 on linux |
Date: | 2023-12-27 18:05:26 |
Message-ID: | CAJghg4+6h4n2TXmsWROx98DcW_gAkRTe00WvtdDEXnXi4yDP7w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On Wed, Dec 27, 2023 at 2:11 PM Wilson, Maria Louise (LARC-E301)[RSES] <
m(dot)l(dot)wilson(at)nasa(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Matheus de Oliveira | 2023-12-27 18:06:45 | Re: [EXTERNAL] Need help with performance tuning pg12 on linux |
Previous Message | Wilson, Maria Louise (LARC-E301)[RSES] | 2023-12-27 17:52:25 | Re: [EXTERNAL] Need help with performance tuning pg12 on linux |