From: | James Pang <jamespang886(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | pgv18: simple table scan take more time than pgv14 |
Date: | 2025-06-20 01:46:06 |
Message-ID: | CAHgTRfc3q_Uv5LLKVi_D7RZjEHeC4YQg0wNG-5sZ+20fqFRVKg@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
same OS RHEL8, install pgv14.11 and pgv18.beta1_3, both installation by RPM
from pgdg, and use similar postgresql.conf.
14.11
postgres=# create table tt(a int primary key, b text);
CREATE TABLE
postgres=# do
postgres-# $$
postgres$# begin
postgres$# for counter in 1..1000000 loop
postgres$# insert into tt values(counter,'jamestest');
postgres$# end loop;
postgres$# end;
postgres$# $$;
DO
pgv14.11
postgres=# \timing on
Timing is on.
postgres=# \timing on
Timing is on.
postgres=# select * from tt where b ~~ 'a%';
a | b
---+---
(0 rows)
Time: 61.018 ms
postgres=# select * from tt where b ~~ 'a%';
a | b
---+---
(0 rows)
Time: 55.082 ms
postgres=# select * from tt where b ~~ 'a%';
a | b
---+---
(0 rows)
Time: 54.716 ms
postgres=# explain select * from tt where b ~~ 'a%';
QUERY PLAN
-------------------------------------------------------
Seq Scan on tt (cost=0.00..17906.00 rows=1 width=14)
Filter: (b ~~ 'a%'::text)
(2 rows)
Time: 0.447 ms
18.beta1
postgres=# \timing on
Timing is on.
postgres=# select * from tt where b ~~ 'a%';
a | b
---+---
(0 rows)
Time: 78.532 ms
postgres=# select * from tt where b ~~ 'a%'
postgres-# ;
a | b
---+---
(0 rows)
Time: 83.516 ms
postgres=# select * from tt where b ~~ 'a%';
a | b
---+---
(0 rows)
Time: 77.117 ms
psql (18beta1)
Type "help" for help.
postgres=# explain select * from tt where b ~~ 'a%';
QUERY PLAN
-------------------------------------------------------
Seq Scan on tt (cost=0.00..17906.00 rows=1 width=14)
Filter: (b ~~ 'a%'::text)
(2 rows)
Regards,
James
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2025-06-20 02:05:37 | Re: problems with toast.* reloptions |
Previous Message | Michael Paquier | 2025-06-20 01:34:19 | Re: Fixes inconsistent behavior in vacuum when it processes multiple relations |