File tree Expand file tree Collapse file tree 4 files changed +80
-0
lines changed Expand file tree Collapse file tree 4 files changed +80
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * expath.c
3+ *
4+ */
5+
6+ #include "postgres.h"
7+
8+ #include "optimizer/pathnode.h"
9+
10+ #include "expath.h"
11+
12+
13+ /*
14+ * FDW paths and EXCHANGE paths are incompatible and can't be combined at a plan.
15+ * We need to construct two non-intersecting path branches across all plan.
16+ * Costs of this plans is not an indicator of path quality at intermediate
17+ * stages of a plan building. We need bypass add_path() path checking procedure.
18+ */
19+ void
20+ force_add_path (RelOptInfo * rel , Path * path )
21+ {
22+ List * pathlist = rel -> pathlist ;
23+
24+ rel -> pathlist = NIL ;
25+ rel -> cheapest_parameterized_paths = NIL ;
26+ rel -> cheapest_startup_path = rel -> cheapest_total_path =
27+ rel -> cheapest_unique_path = NULL ;
28+ add_path (rel , path );
29+ rel -> pathlist = list_concat (rel -> pathlist , pathlist );
30+ set_cheapest (rel );
31+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * expath.h
3+ *
4+ */
5+
6+ #ifndef EXPATH_H_
7+ #define EXPATH_H_
8+
9+ #include "nodes/relation.h"
10+
11+ void force_add_path (RelOptInfo * rel , Path * path );
12+
13+ #endif /* EXPATH_H_ */
Original file line number Diff line number Diff line change 1+ /*
2+ * sbuf.c
3+ *
4+ */
5+
6+ #include "sbuf.h"
7+
8+ void
9+ initTupleBuffer (TupleBuffer * tbuf , size_t mem_size )
10+ {
11+ tbuf -> curptr = & tbuf -> data ;
12+ /* Will corrected before send to DMQ for 'trim tails' purpose. */
13+ tbuf -> size = mem_size ;
14+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * sbuf.h
3+ *
4+ */
5+
6+ #ifndef SBUF_H_
7+ #define SBUF_H_
8+
9+ #include "postgres.h"
10+
11+ typedef struct TupleBuffer
12+ {
13+ size_t size ;
14+ void * curptr ;
15+ char data [FLEXIBLE_ARRAY_MEMBER ];
16+ } TupleBuffer ;
17+
18+ #define DEFAULT_TUPLEBUF_SIZE (BLCKSZ * 2)
19+
20+ extern void initTupleBuffer (TupleBuffer * tbuf , size_t mem_size );
21+
22+ #endif /* SBUF_H_ */
You can’t perform that action at this time.
0 commit comments