[PATCHES] Remove traces of xfunc

2004-04-24 Thread Alvaro Herrera
Hackers,

While playing with the init code I noticed traces of Hellerstein's
expensive function optimization.  It is completely disabled, uses
functions nowhere to be defined, and is out of date.  So I removed it.
Here is the patch.  Note that it takes out the pruneable field from
struct RelOptInfo, since it's not used.

Tom Lane has said a couple of times that he thinks this maybe can be
resurrected; but even if it is, most likely it won't use this code
(what code? These are only hooks.)

(To the patcher: the file src/backend/lib/lispsort.c can also be removed
after this change)

-- 
Alvaro Herrera (alvherre[a]dcc.uchile.cl)
Hoy es el primer día del resto de mi vida
Index: src/backend/optimizer/path/allpaths.c
===
RCS file: /home/alvherre/cvs/pgsql-server/src/backend/optimizer/path/allpaths.c,v
retrieving revision 1.112
diff -c -r1.112 allpaths.c
*** src/backend/optimizer/path/allpaths.c   14 Jan 2004 23:01:55 -  1.112
--- src/backend/optimizer/path/allpaths.c   24 Apr 2004 01:53:10 -
***
*** 531,546 
{
rel = (RelOptInfo *) lfirst(x);
  
- #ifdef NOT_USED
- 
-   /*
-* * for each expensive predicate in each path in each
-* distinct rel, * consider doing pullup  -- JMH
-*/
-   if (XfuncMode != XFUNC_NOPULL  XfuncMode != XFUNC_OFF)
-   xfunc_trypullup(rel);
- #endif
- 
/* Find and save the cheapest paths for this rel */
set_cheapest(rel);
  
--- 531,536 
Index: src/backend/optimizer/plan/createplan.c
===
RCS file: /home/alvherre/cvs/pgsql-server/src/backend/optimizer/plan/createplan.c,v
retrieving revision 1.168
diff -c -r1.168 createplan.c
*** src/backend/optimizer/plan/createplan.c 29 Feb 2004 17:36:05 -  1.168
--- src/backend/optimizer/plan/createplan.c 24 Apr 2004 01:29:14 -
***
*** 167,185 
break;
}
  
- #ifdef NOT_USED   /* fix xfunc */
-   /* sort clauses by cost/(1-selectivity) -- JMH 2/26/92 */
-   if (XfuncMode != XFUNC_OFF)
-   {
-   set_qpqual((Plan) plan,
-  lisp_qsort(get_qpqual((Plan) plan),
- xfunc_clause_compare));
-   if (XfuncMode != XFUNC_NOR)
-   /* sort the disjuncts within each clause by cost -- JMH 3/4/92 
*/
-   xfunc_disjunct_sort(plan-qpqual);
-   }
- #endif
- 
return plan;
  }
  
--- 167,172 
Index: src/backend/optimizer/util/pathnode.c
===
RCS file: /home/alvherre/cvs/pgsql-server/src/backend/optimizer/util/pathnode.c,v
retrieving revision 1.103
diff -c -r1.103 pathnode.c
*** src/backend/optimizer/util/pathnode.c   29 Mar 2004 19:58:04 -  1.103
--- src/backend/optimizer/util/pathnode.c   24 Apr 2004 01:39:45 -
***
*** 243,251 
   *  A path is worthy if it has either a better sort order (better pathkeys)
   *  or cheaper cost (on either dimension) than any of the existing old paths.
   *
!  *  Unless parent_rel-pruneable is false, we also remove from the rel's
!  *  pathlist any old paths that are dominated by new_path --- that is,
!  *  new_path is both cheaper and at least as well ordered.
   *
   *  The pathlist is kept sorted by TOTAL_COST metric, with cheaper paths
   *  at the front.  No code depends on that for correctness; it's simply
--- 243,251 
   *  A path is worthy if it has either a better sort order (better pathkeys)
   *  or cheaper cost (on either dimension) than any of the existing old paths.
   *
!  *  We also remove from the rel's pathlist any old paths that are dominated
!  *  by new_path --- that is, new_path is both cheaper and at least as well
!  *  ordered.
   *
   *  The pathlist is kept sorted by TOTAL_COST metric, with cheaper paths
   *  at the front.  No code depends on that for correctness; it's simply
***
*** 342,351 
}
  
/*
!* Remove current element from pathlist if dominated by new,
!* unless xfunc told us not to remove any paths.
 */
!   if (remove_old  parent_rel-pruneable)
{
List   *p1_next = lnext(p1);
  
--- 342,350 
}
  
/*
!* Remove current element from pathlist if dominated by new.
 */
!   if (remove_old)
{
List   *p1_next = lnext(p1);
  

Re: [PATCHES] Remove traces of xfunc

2004-04-24 Thread Neil Conway
On 24-Apr-04, at 5:58 PM, Alvaro Herrera wrote:
While playing with the init code I noticed traces of Hellerstein's
expensive function optimization.  It is completely disabled, uses
functions nowhere to be defined, and is out of date.  So I removed it.
I'll apply this within 24 hours.

-Neil

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] Remove traces of xfunc

2004-04-24 Thread Alvaro Herrera
On Sun, Apr 25, 2004 at 12:20:01AM -0400, Neil Conway wrote:
 On 24-Apr-04, at 5:58 PM, Alvaro Herrera wrote:
 While playing with the init code I noticed traces of Hellerstein's
 expensive function optimization.  It is completely disabled, uses
 functions nowhere to be defined, and is out of date.  So I removed it.
 
 I'll apply this within 24 hours.

Cool.  I forgot to mention that the Makefile in src/backend/lib has to
be modified too if you drop the lispsort.c file.

-- 
Alvaro Herrera (alvherre[a]dcc.uchile.cl)
Jajaja! Solo hablaba en serio!

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org