Re: PostgreSQL Choosing Full Index Over Partial Index

2025-04-30 Thread Tom Lane
=?UTF-8?Q?Felipe_L=C3=B3pez_Montes?= writes: > Thanks a lot for your response Tom. > May I ask how do you debug those functions? > Or is it just that you read the code and more or less guess what should be > the value for each variable with information coming from querying Postgres > tables? The

Re: PostgreSQL Choosing Full Index Over Partial Index

2025-04-30 Thread Felipe López Montes
Thanks a lot for your response Tom. May I ask how do you debug those functions? Or is it just that you read the code and more or less guess what should be the value for each variable with information coming from querying Postgres tables? Thanks a lot. El lun, 28 abr 2025 a las 17:07, Tom Lane ()

Re: PostgreSQL Choosing Full Index Over Partial Index

2025-04-28 Thread Tom Lane
Laurenz Albe writes: > On Mon, 2025-04-28 at 15:22 +0200, Felipe López Montes wrote: >> Following the book PostgreSQL Query Optimization (Second Edition), there is a >> statement on page 90 talking about Partial Indexes that says that the planner >> will use the partial index rather than the full

Re: PostgreSQL Choosing Full Index Over Partial Index

2025-04-28 Thread Felipe López Montes
Hi Mr. Laurenz, Thanks a lot for your response :). The full index is bigger as it has an entry for all the rows of the table, whilst the partial one only has entries for canceled flights. Output of pgstatindex() for the *partial index:* version,tree_level,index_size,root_block_no,internal_pages

Re: PostgreSQL Choosing Full Index Over Partial Index

2025-04-28 Thread Laurenz Albe
On Mon, 2025-04-28 at 15:22 +0200, Felipe López Montes wrote: > I am using PostgreSQL 17.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) > 12.4.0, 64-bit, > and working with the postgres_air Database. > > I have a very simple query (please forget about the sense of the query itself, > I just want

PostgreSQL Choosing Full Index Over Partial Index

2025-04-28 Thread Felipe López Montes
Hi all, I am using PostgreSQL 17.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 12.4.0, 64-bit, and working with the postgres_air Database . I have a very simple query (please forget about the sense of the query itself, I just want to focus on the planne