Re: Index not used in certain nested views but not in others

2025-05-13 Thread Markus Demleitner
Dear Tom, On Tue, May 13, 2025 at 10:12:46AM -0400, Tom Lane wrote: > Markus Demleitner writes: > > SELECT > > CAST(ssa_dstype AS text) AS dataproduct_type, > > CAST(NULL AS text) AS dataproduct_subtype, > > CAST(2 AS smallint) AS calib_level, > >

Re: Index not used in certain nested views but not in others

2025-05-13 Thread Markus Demleitner
Dear Tom, Dear Laurenz, Thanks for your pointers -- that was already helpful. On Thu, May 01, 2025 at 06:58:45AM +0200, Laurenz Albe wrote: > On Wed, 2025-04-30 at 17:02 -0400, Tom Lane wrote: > > It's hard to be sure when you've shown us no table definitions and > > only fragments of the view de

Index not used in certain nested views but not in others

2025-04-30 Thread Markus Demleitner
Dear List, I know how tedious mails with a subject of the type "I don't understand what the planner does" are, but on this one I'm really stumped. Regrettably, the situation is also a bit complex. Hopefully, someone will bear with me. So, in a PostgreSQL 15.12 I have a view over a single table w

Re: SELECT DISTINCT scans the table?

2021-12-17 Thread Markus Demleitner
Dear Tom, On Thu, Dec 16, 2021 at 03:47:57PM -0500, Tom Lane wrote: > Markus Demleitner writes: > > Maximally stripped down, my problem is that > > > select distinct 300 from > > > seqscans (at least in PostgreSQL 11.14). To me, it seems > > obvious t

SELECT DISTINCT scans the table?

2021-12-16 Thread Markus Demleitner
Dear list, This feels like a FAQ, but neither the postgres docs nor web searches got me a single step towards some sort of insight. Maximally stripped down, my problem is that select distinct 300 from seqscans (at least in PostgreSQL 11.14). To me, it seems obvious that this ought be be ju