Re: EXPLAIN (ANALYZE, BUFFERS) - puzzling numbers for a simple query. - Mailing list pgsql-general

From Pól Ua Laoínecháin
Subject Re: EXPLAIN (ANALYZE, BUFFERS) - puzzling numbers for a simple query.
Date
Msg-id CAF4RT5Q5pUb5_S1NK-Q7_o76anP7Kt6aFjxwhv7QNVpGtc+C0w@mail.gmail.com
Whole thread Raw
In response to Re: EXPLAIN (ANALYZE, BUFFERS) - puzzling numbers for a simple query.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Laurenz Albe <laurenz.albe@cybertec.at> writes:

> > "generate_series" has a support function from v12 on:

> True, but I don't think it can do anything with non-constant inputs,
> as we have in the OP's case.


As confirmed by this:

https://dbfiddle.uk/?rdbms=postgres_12&fiddle=d0b70717faca3b094be8b4a096758b94

Plan:

==============
Sort (cost=623.22..640.72 rows=7000 width=10) (actual
time=0.067..0.070 rows=42 loops=1)
Sort Key: id, (((generate_series((start_date)::timestamp with time
zone, (end_date)::timestamp with time zone, '1
day'::interval)))::date)
Sort Method: quicksort Memory: 26kB
Buffers: shared hit=1
-> Result (cost=0.00..176.16 rows=7000 width=10) (actual
time=0.014..0.045 rows=42 loops=1)
Buffers: shared hit=1
-> ProjectSet (cost=0.00..36.16 rows=7000 width=14) (actual
time=0.013..0.033 rows=42 loops=1)
CUT
==============

It goes for the full 7,000 even after a VACUUM FULL VERBOSE ANALYZE test;


Pól...

>                         regards, tom lane



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: strange behavior of WAL files
Next
From: Adrian Klaver
Date:
Subject: Re: BUG #17046: Upgrade postgres 11 to 13 version