Re: Regarding query optimisation (select for update)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Regarding query optimisation (select for update)
Date: 2025-07-15 14:45:44
Message-ID: 903134.1752590744@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> Text is easier to read than images...

Indeed.

> Anyway, this statement was done in under a millisecond.
> I wouldn't call that slow...

It looks to me like this EXPLAIN ANALYZE was done against a totally
empty table, so probably in a freshly-set-up dev environment. That
is not going to be helpful in identifying your production problem.
Note the caveat at [1]:

EXPLAIN results should not be extrapolated to situations much
different from the one you are actually testing; for example,
results on a toy-sized table cannot be assumed to apply to large
tables.

regards, tom lane

[1] https://www.postgresql.org/docs/current/using-explain.html#USING-EXPLAIN-CAVEATS

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Kukushkin 2025-07-15 14:48:05 Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Previous Message Laurenz Albe 2025-07-15 14:06:20 Re: Regarding query optimisation (select for update)