geqo.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*-------------------------------------------------------------------------
  2. *
  3. * geqo.h
  4. * prototypes for various files in optimizer/geqo
  5. *
  6. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994, Regents of the University of California
  8. *
  9. * src/include/optimizer/geqo.h
  10. *
  11. *-------------------------------------------------------------------------
  12. */
  13. /* contributed by:
  14. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  15. * Martin Utesch * Institute of Automatic Control *
  16. = = University of Mining and Technology =
  17. * utesch@aut.tu-freiberg.de * Freiberg, Germany *
  18. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  19. */
  20. #ifndef GEQO_H
  21. #define GEQO_H
  22. #include "nodes/relation.h"
  23. #include "optimizer/geqo_gene.h"
  24. /* GEQO debug flag */
  25. /*
  26. #define GEQO_DEBUG
  27. */
  28. /* recombination mechanism */
  29. /*
  30. #define ERX
  31. #define PMX
  32. #define CX
  33. #define PX
  34. #define OX1
  35. #define OX2
  36. */
  37. #define ERX
  38. /*
  39. * Configuration options
  40. *
  41. * If you change these, update backend/utils/misc/postgresql.conf.sample
  42. */
  43. extern int Geqo_effort; /* 1 .. 10, knob for adjustment of defaults */
  44. #define DEFAULT_GEQO_EFFORT 5
  45. #define MIN_GEQO_EFFORT 1
  46. #define MAX_GEQO_EFFORT 10
  47. extern int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
  48. extern int Geqo_generations; /* 1 .. inf, or 0 to use default */
  49. extern double Geqo_selection_bias;
  50. #define DEFAULT_GEQO_SELECTION_BIAS 2.0
  51. #define MIN_GEQO_SELECTION_BIAS 1.5
  52. #define MAX_GEQO_SELECTION_BIAS 2.0
  53. extern double Geqo_seed; /* 0 .. 1 */
  54. /*
  55. * Private state for a GEQO run --- accessible via root->join_search_private
  56. */
  57. typedef struct
  58. {
  59. List *initial_rels; /* the base relations we are joining */
  60. unsigned short random_state[3]; /* state for pg_erand48() */
  61. } GeqoPrivateData;
  62. /* routines in geqo_main.c */
  63. extern RelOptInfo *geqo(PlannerInfo *root,
  64. int number_of_rels, List *initial_rels);
  65. /* routines in geqo_eval.c */
  66. extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
  67. extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
  68. #endif /* GEQO_H */