aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/parser/pg_wrapper/cost_mocks.cpp
blob: 57b75427daa3615d7a49bf17baed932e5ec5e176 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <util/system/compiler.h>

#define TypeName PG_TypeName
#define SortBy PG_SortBy
#undef SIZEOF_SIZE_T

extern "C" {
#include "postgres.h"
#include "optimizer/paths.h"
#include "nodes/print.h"
#include "utils/selfuncs.h"
#include "utils/palloc.h"
}

#undef Min
#undef Max
#undef TypeName
#undef SortBy


extern "C" void
add_function_cost(PlannerInfo *root, Oid funcid, Node *node,
				  QualCost *cost)
{
    Y_UNUSED(root);
    Y_UNUSED(funcid);
    Y_UNUSED(node);
	cost->per_tuple += 100000;
}

extern "C" bool
op_mergejoinable(Oid opno, Oid inputtype) {
    Y_UNUSED(opno);
    Y_UNUSED(inputtype);
    return false;
}

extern "C" bool
op_hashjoinable(Oid opno, Oid inputtype) {
    Y_UNUSED(opno);
    Y_UNUSED(inputtype);
    return true;
}

extern "C" RegProcedure
get_oprjoin(Oid opno)
{
    Y_UNUSED(opno);
	return 105;
}

extern "C" char
func_volatile(Oid funcid)
{
    Y_UNUSED(funcid);
    return 'i';
}