Patch to apply an optional patch on databases/ip4r to make the planner prefer indexes on ip4r joins when the tables are more like production size ;-) ...
The ip4r plugin has no statistics collection for ip4r so it will use/prefer sequence scanning when tables exceed around 40,000 rows, or if the join is more complex, when using the extended operators (specifically those with GiST indexes)
If the table doesn't use the GiST index this patch does nothing. If the table has only a few hundred rows forcing/preferring the GiST index can slow the queries
The actual patch is a simple patch that just changes the internal weighting of the statistics calculation and was made originally for ip4r-v1.x with the help of the authors of the ip4r plugin. It has been modified to work on ip4r-2.x only now.
Fix: Diff to the databases/ip4r directory that provides an option to apply is attached, and is available here:
Patch attached with submission follows:
Over to maintainer (via the GNATS Auto Assign Tool)
A commit references this bug:
Date: Mon Jul 7 05:27:18 UTC 2014
New revision: 361022
databases/ip4r: patch to prefer ip4r indexes over seq_scan on large datasets
- add option to prefer ip4r indexes over seq_scan on large datasets
Submitted by: email@example.com
Approved by: maintainer (timeout)
The fix has been already committed, so I am closing this PR.