cost_mocks.cpp 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include <util/system/compiler.h>
  2. #define TypeName PG_TypeName
  3. #define SortBy PG_SortBy
  4. #undef SIZEOF_SIZE_T
  5. extern "C" {
  6. #include "postgres.h"
  7. #include "optimizer/paths.h"
  8. #include "nodes/print.h"
  9. #include "utils/selfuncs.h"
  10. #include "utils/palloc.h"
  11. }
  12. #undef Min
  13. #undef Max
  14. #undef TypeName
  15. #undef SortBy
  16. extern "C" void
  17. add_function_cost(PlannerInfo *root, Oid funcid, Node *node,
  18. QualCost *cost)
  19. {
  20. Y_UNUSED(root);
  21. Y_UNUSED(funcid);
  22. Y_UNUSED(node);
  23. cost->per_tuple += 100000;
  24. }
  25. extern "C" bool
  26. op_mergejoinable(Oid opno, Oid inputtype) {
  27. Y_UNUSED(opno);
  28. Y_UNUSED(inputtype);
  29. return false;
  30. }
  31. extern "C" bool
  32. op_hashjoinable(Oid opno, Oid inputtype) {
  33. Y_UNUSED(opno);
  34. Y_UNUSED(inputtype);
  35. return true;
  36. }
  37. extern "C" RegProcedure
  38. get_oprjoin(Oid opno)
  39. {
  40. Y_UNUSED(opno);
  41. return 105;
  42. }
  43. extern "C" char
  44. func_volatile(Oid funcid)
  45. {
  46. Y_UNUSED(funcid);
  47. return 'i';
  48. }