Re: How to tune SQL performance of function based columns of a view

From: Sai Sadashiva Kundurmutt <saisadashiva2000(at)gmail(dot)com>
To: M Sarwar <sarwarmd02(at)outlook(dot)com>
Cc: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: How to tune SQL performance of function based columns of a view
Date: 2024-04-08 06:38:24
Message-ID: CAH6hFGLbt4OCqzJB0M5fgx30FFQC4=1pCEHF5JLapn8J1ROavw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,
I am relatively new to Postgres but this is my suggestion: Try to add an
index on the column *substring"(p.SERIAL_NUMBER::TEXT, '[A-Z][0-9]+'::TEXT)
*?
Also, analyze the table after adding the index. If index scan is chosen
after this performance might improve(I tried to experiment by creating a
table with a text field in it and running a similar query on it).

Thank you,
Warm regards,
Sai Sadashiva JK

On Mon, 8 Apr 2024 at 10:22, M Sarwar <sarwarmd02(at)outlook(dot)com> wrote:

>
> Hi Ron,
>
> I have analyzed and vacuumed following 2 tables which are used by the
> views.
>
> TEK_INSPECTION_LIST_MCM
>
> TEST_PART_DETAILS_ALL_MCM_MID
>
>
> I am still seeing unacceptable response time.
>
> Is there any other way to tune a SQL which is referring a view?
>
> Thanks,
> Sarwar
>
>
> ------------------------------
> *From:* Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
> *Sent:* Saturday, April 6, 2024 9:58 AM
> *To:* pgsql-admin(at)lists(dot)postgresql(dot)org <pgsql-admin(at)lists(dot)postgresql(dot)org>
> *Subject:* Re: How to tune SQL performance of function based columns of a
> view
>
>
> Postgresql does auto-vacuum and auto-analyze, so the table might have been
> analyzed and vacuumed.
>
> Table pg_stat_user_tables records the last time that user tables were
> vacuumed and analyzed.
>
> On Sat, Apr 6, 2024 at 4:44 AM M Sarwar <sarwarmd02(at)outlook(dot)com> wrote:
>
> This is Pg 13.
> It is running on Aws / Rds.
> I am not doing any Vacuum/ Analyze manually.
> Thanks,
> Sarwar
>
>
>
>
> Sent from my Galaxy
>
>
>
> -------- Original message --------
> From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
> Date: 4/6/24 1:15 AM (GMT-05:00)
> To: pgsql-admin(at)lists(dot)postgresql(dot)org
> Subject: Re: How to tune SQL performance of function based columns of a
> view
>
> On Sat, Apr 6, 2024 at 12:33 AM M Sarwar <sarwarmd02(at)outlook(dot)com> wrote:
>
>
>
> Hello,
>
>
>
> I am working on SQL performance issue.
>
>
> 1. What PG version?
> 2. When did you last VACUUM and ANALYZE the base tables?
>
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rajesh Kumar 2024-04-08 06:50:06 Work_mem
Previous Message Siraj G 2024-04-08 06:00:53 Enable DB level audit trail