geqo.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*-------------------------------------------------------------------------
  2. *
  3. * geqo.h
  4. * prototypes for various files in optimizer/geqo
  5. *
  6. * Portions Copyright (c) 1996-2022, 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. * [email protected] * Freiberg, Germany *
  18. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  19. */
  20. #ifndef GEQO_H
  21. #define GEQO_H
  22. #include "common/pg_prng.h"
  23. #include "nodes/pathnodes.h"
  24. #include "optimizer/geqo_gene.h"
  25. /* GEQO debug flag */
  26. /*
  27. #define GEQO_DEBUG
  28. */
  29. /* choose one recombination mechanism here */
  30. /*
  31. #define ERX
  32. #define PMX
  33. #define CX
  34. #define PX
  35. #define OX1
  36. #define OX2
  37. */
  38. #define ERX
  39. /*
  40. * Configuration options
  41. *
  42. * If you change these, update backend/utils/misc/postgresql.conf.sample
  43. */
  44. extern PGDLLIMPORT int Geqo_effort; /* 1 .. 10, knob for adjustment of
  45. * defaults */
  46. #define DEFAULT_GEQO_EFFORT 5
  47. #define MIN_GEQO_EFFORT 1
  48. #define MAX_GEQO_EFFORT 10
  49. extern PGDLLIMPORT int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
  50. extern PGDLLIMPORT int Geqo_generations; /* 1 .. inf, or 0 to use default */
  51. extern PGDLLIMPORT double Geqo_selection_bias;
  52. #define DEFAULT_GEQO_SELECTION_BIAS 2.0
  53. #define MIN_GEQO_SELECTION_BIAS 1.5
  54. #define MAX_GEQO_SELECTION_BIAS 2.0
  55. extern PGDLLIMPORT double Geqo_seed; /* 0 .. 1 */
  56. /*
  57. * Private state for a GEQO run --- accessible via root->join_search_private
  58. */
  59. typedef struct
  60. {
  61. List *initial_rels; /* the base relations we are joining */
  62. pg_prng_state random_state; /* PRNG state */
  63. } GeqoPrivateData;
  64. /* routines in geqo_main.c */
  65. extern RelOptInfo *geqo(PlannerInfo *root,
  66. int number_of_rels, List *initial_rels);
  67. /* routines in geqo_eval.c */
  68. extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
  69. extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
  70. #endif /* GEQO_H */