Re: Query plan regression between CTE and views

2023-08-15 Thread David Gilman
I'm on PostgreSQL 15 with essentially a stock configuration. On Tue, Aug 15, 2023 at 8:58 AM Ron wrote: > > On 8/14/23 09:54, David Gilman wrote: > > I have a query that was originally written as a handful of CTEs out of > > convenience. It is producing a reasonable query pl

Query plan regression between CTE and views

2023-08-14 Thread David Gilman
r. My question is: is this a valid bug? I am not sure if I should expect the view version to find a way to materialize and produce a comparable query plan. Also, making a minimal test case is going to take a bit and I don't want to start unless this smells like a genuine bug. -- David Gilman :DG<

Re: Implementing foreign data wrappers and avoiding n+1 querying

2022-12-22 Thread David Gilman
, 10:57 PM David Rowley wrote: > On Thu, 22 Dec 2022 at 13:31, David Gilman wrote: > > > > When a fdw table participates in query planning and finds itself as > > part of a join it can output a parameterized path. If chosen, Postgres > > will dutifully cal

Implementing foreign data wrappers and avoiding n+1 querying

2022-12-21 Thread David Gilman
When a fdw table participates in query planning and finds itself as part of a join it can output a parameterized path. If chosen, Postgres will dutifully call the fdw over and over via IterateForeignScan to fetch matching tuples. Many fdw extensions do network traffic, though, and it would be