1 /*-------------------------------------------------------------------------
3 * pgsp_json_text.h: Defenitions for text plan generator for pg_store_plan.
5 * Copyright (c) 2012-2019, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
8 * pg_store_plan/pgsp_json_text.h
10 *-------------------------------------------------------------------------
15 const char *sort_keys;
23 const char *node_type;
24 const char *operation;
25 const char *subplan_name;
28 const char *index_name;
30 const char *schema_name;
33 const char *join_filter;
34 const char *rows_removed_by_filter;
38 const char *func_call;
39 const char *sort_method;
44 const char *index_cond;
45 const char *merge_cond;
46 const char *hash_cond;
48 const char *recheck_cond;
49 const char *hash_buckets;
50 const char *hash_batches;
51 const char *setopcommand;
52 const char *join_type;
53 const char *org_hash_batches;
54 const char *org_hash_buckets;
55 const char *peak_memory_usage;
56 const char *startup_cost;
57 const char *total_cost;
58 const char *plan_rows;
59 const char *plan_width;
60 const char *sort_space_used;
61 const char *sort_space_type;
62 const char *actual_startup_time;
63 const char *actual_total_time;
64 const char *actual_rows;
65 const char *actual_loops;
66 const char *heap_fetches;
67 const char *shared_hit_blks;
68 const char *shared_read_blks;
69 const char *shared_dirtied_blks;
70 const char *shared_written_blks;
71 const char *local_hit_blks;
72 const char *local_read_blks;
73 const char *local_dirtied_blks;
74 const char *local_written_blks;
75 const char *temp_read_blks;
76 const char *temp_written_blks;
77 const char *io_read_time;
78 const char *io_write_time;
79 const char *filter_removed;
80 const char *idxrchk_removed;
81 const char *trig_name;
82 const char *trig_relation;
83 const char *trig_time;
84 const char *trig_calls;
85 const char *plan_time;
86 const char *exec_time;
87 const char *exact_heap_blks;
88 const char *lossy_heap_blks;
89 const char *joinfilt_removed;
90 const char *conflict_resolution;
91 StringInfo conflict_arbiter_indexes;
92 const char *tuples_inserted;
93 const char *conflicting_tuples;
94 const char *sampling_method;
95 StringInfo sampling_params;
96 const char *repeatable_seed;
98 const char *partial_mode;
99 const char *worker_number;
100 const char *workers_planned;
101 const char *workers_launched;
103 const char *table_func_name;
105 const char *tmp_obj_name;
106 const char *tmp_schema_name;
107 const char *tmp_alias;
112 #define SETTER(name) pgsp_node_set_##name
114 #define SETTERDECL(name) extern void SETTER(name)(node_vals *vals, const char *val)
115 #define DEFAULT_SETTER(name) \
116 SETTERDECL(name) { vals->name = val;}
118 #define SQLQUOTE_SETTER(name) \
119 SETTERDECL(name) { vals->name = quote_identifier(val);}
121 #define BOOL_SETTER(name) \
122 SETTERDECL(name) { vals->parallel_aware = (strcmp(val, "true") == 0 ? 1 : 0);}
124 #define LIST_SETTER(name) \
126 if (!vals->name || !vals->name->data[0])\
128 vals->name = makeStringInfo(); \
129 appendStringInfoString(vals->name, val); \
133 appendStringInfoString(vals->name, ", "); \
134 appendStringInfoString(vals->name, val); \
138 #define CONVERSION_SETTER(name, converter) \
139 SETTERDECL(name) { vals->name = converter(val, PGSP_JSON_TEXTIZE);}
141 extern char *pgsp_json_textize(char *json);
143 /* Prototypes for setter for node_vals */
145 SETTERDECL(node_type);
146 SETTERDECL(scan_dir);
147 SETTERDECL(obj_name);
148 SETTERDECL(schema_name);
151 SETTERDECL(strategy);
152 SETTERDECL(join_type);
153 SETTERDECL(setopcommand);
154 SETTERDECL(sort_method);
155 SETTERDECL(sort_key);
156 SETTERDECL(group_key);
157 SETTERDECL(group_keys);
158 SETTERDECL(hash_key);
159 SETTERDECL(parallel_aware);
160 SETTERDECL(partial_mode);
161 SETTERDECL(index_name);
162 SETTERDECL(startup_cost);
163 SETTERDECL(total_cost);
164 SETTERDECL(plan_rows);
165 SETTERDECL(plan_width);
166 SETTERDECL(sort_space_used);
167 SETTERDECL(sort_space_type);
169 SETTERDECL(join_filter);
170 SETTERDECL(func_call);
171 SETTERDECL(operation);
172 SETTERDECL(subplan_name);
173 SETTERDECL(index_cond);
174 SETTERDECL(hash_cond);
175 SETTERDECL(merge_cond);
176 SETTERDECL(tid_cond);
177 SETTERDECL(recheck_cond);
178 SETTERDECL(hash_buckets);
179 SETTERDECL(hash_batches);
180 SETTERDECL(org_hash_batches);
181 SETTERDECL(org_hash_buckets);
182 SETTERDECL(peak_memory_usage);
183 SETTERDECL(filter_removed);
184 SETTERDECL(idxrchk_removed);
185 SETTERDECL(actual_startup_time);
186 SETTERDECL(actual_total_time);
187 SETTERDECL(actual_rows);
188 SETTERDECL(actual_loops);
189 SETTERDECL(heap_fetches);
190 SETTERDECL(shared_hit_blks);
191 SETTERDECL(shared_read_blks);
192 SETTERDECL(shared_dirtied_blks);
193 SETTERDECL(shared_written_blks);
194 SETTERDECL(local_hit_blks);
195 SETTERDECL(local_read_blks);
196 SETTERDECL(local_dirtied_blks);
197 SETTERDECL(local_written_blks);
198 SETTERDECL(temp_read_blks);
199 SETTERDECL(temp_written_blks);
200 SETTERDECL(io_read_time);
201 SETTERDECL(io_write_time);
202 SETTERDECL(trig_name);
203 SETTERDECL(trig_relation);
204 SETTERDECL(trig_time);
205 SETTERDECL(trig_calls);
206 SETTERDECL(plan_time);
207 SETTERDECL(exec_time);
208 SETTERDECL(exact_heap_blks);
209 SETTERDECL(lossy_heap_blks);
210 SETTERDECL(joinfilt_removed);
211 SETTERDECL(conflict_resolution);
212 SETTERDECL(conflict_arbiter_indexes);
213 SETTERDECL(tuples_inserted);
214 SETTERDECL(conflicting_tuples);
215 SETTERDECL(sampling_method);
216 SETTERDECL(sampling_params);
217 SETTERDECL(repeatable_seed);
218 SETTERDECL(worker_number);
219 SETTERDECL(workers_planned);
220 SETTERDECL(workers_launched);
221 SETTERDECL(inner_unique);
222 SETTERDECL(table_func_name);