[Groonga-commit] pgroonga/pgroonga at ec84d0d [master] Use the default cost estimation again

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Sun May 24 00:19:15 JST 2015


Kouhei Sutou	2015-05-24 00:19:15 +0900 (Sun, 24 May 2015)

  New Revision: ec84d0daa0d9c2a0e2c0988658cfbc4ca79e9db0
  https://github.com/pgroonga/pgroonga/commit/ec84d0daa0d9c2a0e2c0988658cfbc4ca79e9db0

  Message:
    Use the default cost estimation again
    
    Because the naive implementation doesn't work well for OR search.

  Modified files:
    pgroonga.c

  Modified: pgroonga.c (+13 -3)
===================================================================
--- pgroonga.c    2015-05-24 00:09:16 +0900 (3bcce9b)
+++ pgroonga.c    2015-05-24 00:19:15 +0900 (0472125)
@@ -2553,6 +2553,9 @@ pgroonga_vacuumcleanup(PG_FUNCTION_ARGS)
 Datum
 pgroonga_costestimate(PG_FUNCTION_ARGS)
 {
+	return gistcostestimate(fcinfo);
+
+#ifdef NOT_USED
 	PlannerInfo *root = (PlannerInfo *) PG_GETARG_POINTER(0);
 	IndexPath *path = (IndexPath *) PG_GETARG_POINTER(1);
 	double loopCount = PG_GETARG_FLOAT8(2);
@@ -2563,9 +2566,15 @@ pgroonga_costestimate(PG_FUNCTION_ARGS)
 	IndexOptInfo *index = path->indexinfo;
 
 	/* TODO: Use more clever logic.
-	 * We want to use index scan instead of bitmap scan for full text search.
-	 * We want to use the default scan for other operators such as <,
-	 * <= and so on.
+	 *
+	 * We want to use index scan rather than bitmap scan for full text search.
+	 * Because bitmap scan requires bitmap heap scan that is slow for
+	 * large result set.
+	 *
+	 * We want to use bitmap scan rather than index scan for OR search.
+	 * Because we can't use index scan for OR search.
+	 *
+	 * We want to use the default scan for other cases.
 	 */
 	*indexSelectivity = clauselist_selectivity(root,
 											   path->indexquals,
@@ -2578,6 +2587,7 @@ pgroonga_costestimate(PG_FUNCTION_ARGS)
 	*indexCorrelation = 0.0;
 
 	PG_RETURN_VOID();
+#endif
 }
 
 /**
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る