effect on planner of turning a subquery to a table, sql function returning table

2024-04-12 Thread Thierry Henrio
Hi there, I work on a booking system. Below is a query showing reservations of devices that overlaps a campaign. A campaign has duration and time intervals by day of week. Here is a query (A): select device_id, t.date, timerange(t.start_time, t.end_time) * g.times as times from device_time

Obsolete Linux downloads (Debian) instructions

2024-04-12 Thread Laura Smith
Hi Who do I have to badger to get the obsolete and frankly dangerous Debian repo instructions fixed @ https://www.postgresql.org/download/linux/debian/ ?  The manner proposed is really "not the done thing" in 2024 and it has been explicitly obsoleted by Debian so the project really should not b

Re: Obsolete Linux downloads (Debian) instructions

2024-04-12 Thread Daniel Gustafsson
> On 12 Apr 2024, at 12:43, Laura Smith > wrote: > Who do I have to badger to get the obsolete and frankly dangerous Debian repo > instructions fixed @ https://www.postgresql.org/download/linux/debian/ ? Badgering is usually not required when it comes to fixing broken things, assuming they are

Re: effect on planner of turning a subquery to a table, sql function returning table

2024-04-12 Thread David Rowley
On Fri, 12 Apr 2024 at 22:33, Thierry Henrio wrote: > Here is (B) execution plan: To be able to determine if a plan is good or bad, we'd really need to see the EXPLAIN (ANALYZE) output rather than just the EXPLAIN ouput. To save a possible roundtrip; SET track_io_timing = ON; EXPLAIN (ANALYZE,

Re: effect on planner of turning a subquery to a table, sql function returning table

2024-04-12 Thread Thierry Henrio
Thanks David! Here are the plans with (ANALYZE, BUFFERS), and track_io_timing ON: (A) GroupAggregate (cost=401037.82..503755.82 rows=1467400 width=124) (actual time=416.851..426.534 rows=4670 loops=1) Group Key: t.device_id, t.date, t.start_time, t.end_time, (timerange(((t_1.value ->> 0))::

Re: effect on planner of turning a subquery to a table, sql function returning table

2024-04-12 Thread David Rowley
On Fri, 12 Apr 2024 at 23:27, Thierry Henrio wrote: > JIT: >Functions: 36 >Options: Inlining true, Optimization true, Expressions true, Deforming true >Timing: Generation 1.949 ms, Inlining 28.891 ms, Optimization 207.481 ms, > Emission 134.907 ms, Total 373.228 ms > Execution Time:

Re: effect on planner of turning a subquery to a table, sql function returning table

2024-04-12 Thread Thierry Henrio
Thanks David! Setting jit to 0: GroupAggregate (cost=401037.82..503755.82 rows=1467400 width=124) (actual time=56.603..68.908 rows=4670 loops=1) Group Key: t.device_id, t.date, t.start_time, t.end_time, (timerange(((t_1.value ->> 0))::time without time zone, ((t_1.value ->> 1))::time without