Re: postgresql long running query

From: "Edward J(dot) Sabol" <edwardjsabol(at)gmail(dot)com>
To: liam saffioti <liam(dot)saffiotti(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>, Julien Rouhaud <rjuju123(at)gmail(dot)com>
Subject: Re: postgresql long running query
Date: 2021-12-03 17:35:12
Message-ID: 16EC7A7C-5A5C-469D-BE91-B98606E00EC8@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Dec 3, 2021, at 8:11 AM, liam saffioti <liam(dot)saffiotti(at)gmail(dot)com> wrote:
> Indexes:
> "T_CMN_SLAHISTORY_HistoryId_idx" UNIQUE, btree ("HistoryId")
> "Index-20180207-152712" btree ("RuleName", "DefinitionId")
> "Index-20180712-192739" btree ("DefinitionId", "IsOldRecordBatch")
> "Index-20180712-192836" btree ("InstanceId")

Your query was "...WHERE x."DefinitionId" = '302';", but you don't have an index on *just* "DefinitionId". Try creating one.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Dischner, Anton 2021-12-06 08:21:26 AW: postgresql long running query
Previous Message liam saffioti 2021-12-03 13:11:59 Re: postgresql long running query