Re: Small table selection extremely slow! - Mailing list pgsql-sql

From David Rowley
Subject Re: Small table selection extremely slow!
Date
Msg-id CAApHDvriMd3RpH9khEV_p+tgqOexRvS7HT1isfdv1OjMA0wSBw@mail.gmail.com
Whole thread Raw
In response to Small table selection extremely slow!  (Bo Guo <bo.guo@gisticinc.com>)
List pgsql-sql
On Tue, 14 May 2024 at 23:12, Bo Guo <bo.guo@gisticinc.com> wrote:
> The following query took 20 seconds on a small table of 108 rows with a dozen columns:
>
> SELECT * FROM azgiv.layers;
>
> EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM azgiv.layers;
> Seq Scan on layers  (cost=0.00..14.00 rows=200 width=233) (actual time=0.010..0.087 rows=200 loops=1)
>   Buffers: shared hit=12
> Planning:
>   Buffers: shared hit=51
>  Planning Time: 0.233 ms
>  Execution Time: 0.121 ms

One difference between the SELECT and EXPLAIN ANALYZE is that SELECT
will detoast your toasted datums whereas EXPLAIN ANALYZE will not.

It's likely the slowness comes from the detoasting.

David



pgsql-sql by date:

Previous
From: Bo Guo
Date:
Subject: Small table selection extremely slow!
Next
From: MichaelDBA
Date:
Subject: Re: Small table selection extremely slow!