Opened 10 years ago

Closed 10 years ago

#2895 closed enhancement (fixed)

Increase cost of ST_ConvexHull(raster)

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.1.4
Component: raster Version: 2.1.x
Keywords: history Cc:

Description

The cost of ST_ConvexHull(raster) is currently set to 1. For comparison ST_ConvexHull(geometry) is 100, and st_intersects(raster, raster) is 1000.

Real world cases have been found where a cost of 100 is not enough for the planner to choose a functional index scan for a query using a spatial condition on the raster column, while such index scan would take half the time (probably due to the pre-computation of the function output). See http://lists.osgeo.org/pipermail/postgis-devel/2014-August/024461.html

Raising it to 200 seems enough for the specific case.

It's to be determined out to deal with upgrades on function cost changes.

See #2839 for the change that made the problem more evident.

Change History (6)

comment:1 by robe, 10 years ago

I'm in agreement we need to up the cost on this. Didn't realize it was so low. I would go to 300 in fact as its more costly.

Hmm upgrades on function cost changes. Why do you need to do anything special with those? I would think putting in a CHANGED would be sufficient. Function costs are already part of the upgrade script.

comment:2 by robe, 10 years ago

Component: postgisraster
Owner: changed from pramsey to dustymugs

comment:3 by strk, 10 years ago

Owner: changed from dustymugs to strk
Status: newassigned

comment:4 by strk, 10 years ago

Raised to 300 in trunk with r12888. You are right upgrades are easy. Do you think I should backport to the 2.1 branch ?

comment:5 by robe, 10 years ago

Yes definitely

comment:6 by strk, 10 years ago

Keywords: history added
Milestone: PostGIS 2.2.0PostGIS 2.1.4
Resolution: fixed
Status: assignedclosed
Version: trunk2.1.x

r12892 for the 2.1 branch

Note: See TracTickets for help on using tickets.