Bug 190104 - Patch to make databases/ip4r prefer indexes on large (ie in production) databases
Summary: Patch to make databases/ip4r prefer indexes on large (ie in production) datab...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Anton Berezin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-22 13:00 UTC by Michelle Sullivan
Modified: 2015-03-29 11:00 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (1.27 KB, patch)
2014-05-22 13:00 UTC, Michelle Sullivan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michelle Sullivan 2014-05-22 13:00:00 UTC
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:

http://flashback.sorbs.net/packages/databases_ip4r-portoption-preferindex.patch



Patch attached with submission follows:
How-To-Repeat: N/A
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-22 22:01:53 UTC
Responsible Changed
From-To: freebsd-ports-bugs->tobez

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-07-07 05:28:18 UTC
A commit references this bug:

Author: pi
Date: Mon Jul  7 05:27:18 UTC 2014
New revision: 361022
URL: http://svnweb.freebsd.org/changeset/ports/361022

Log:
  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

  PR:		190104
  Submitted by:	michelle@sorbs.net
  Approved by:	maintainer (timeout)

Changes:
  head/databases/ip4r/Makefile
  head/databases/ip4r/distinfo
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2014-07-07 05:31:18 UTC
Committed, thanks!
Comment 4 Bartek Rutkowski freebsd_committer freebsd_triage 2015-03-29 11:00:53 UTC
The fix has been already committed, so I am closing this PR.