[HACKERS] Split conditions on relations - Mailing list pgsql-hackers

From Jim Nasby
Subject [HACKERS] Split conditions on relations
Date
Msg-id 1add3cd0-75a9-61d9-2856-cc529bad0e16@openscg.com
Whole thread Raw
List pgsql-hackers
I've got a customer that is running a pretty expensive function as part 
of a WHERE clause. With or without the function, the table the function 
references is the inner-most of a series of nested loops. Without the 
function things are very fast, but adding the function increases the 
cost of the index scan on that table by a factor of ~80x. It also 
falsely skews the row estimate further down, causing a bad shift to 
materialization in another part of the query, but that's a different 
problem. Wrapping the majority of the query in an OFFSET 0 with the 
function call on the outside makes things fast again.

It'd be nice if function execution could be delayed to a higher level of 
a query based on the cost.
-- 
Jim Nasby, Chief Data Architect, OpenSCG
http://OpenSCG.com



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] multivariate statistics (v25)
Next
From: vinayak
Date:
Subject: Re: [HACKERS] pg_stat_wal_write statistics view