Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
akuzm committed Dec 5, 2024
1 parent 6194250 commit d18bef0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 36 deletions.
4 changes: 0 additions & 4 deletions src/import/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ ts_make_sort(Plan *lefttree, int numCols, AttrNumber *sortColIdx, Oid *sortOpera
node->collations = collations;
node->nullsFirst = nullsFirst;

// fprintf(stderr, "ts make sort\n");
// mybt();
// my_print(node);

return node;
}

Expand Down
10 changes: 0 additions & 10 deletions src/nodes/chunk_append/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ adjust_childscan(PlannerInfo *root, Plan *plan, Path *path, List *pathkeys, List
&collations,
&nullsFirst);

fprintf(stderr, "required pathkeys:\n");
my_print(pathkeys);

fprintf(stderr, "child scan pathkeys:\n");
my_print(path->pathkeys);

/* inject sort node if child sort order does not match desired order */
if (!pathkeys_contained_in(pathkeys, path->pathkeys))
{
Expand Down Expand Up @@ -333,10 +327,6 @@ make_sort(Plan *lefttree, int numCols, AttrNumber *sortColIdx, Oid *sortOperator
node->collations = collations;
node->nullsFirst = nullsFirst;

fprintf(stderr, "make sort chunk append\n");
mybt();
my_print(node);

return node;
}

Expand Down
3 changes: 3 additions & 0 deletions src/planner/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ ts_rte_is_hypertable(const RangeTblEntry *rte)
return ht != NULL;
}

#define IS_UPDL_CMD(parse) \
((parse)->commandType == CMD_UPDATE || (parse)->commandType == CMD_DELETE)

typedef struct
{
Query *rootquery;
Expand Down
3 changes: 0 additions & 3 deletions src/planner/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
*/
#define PLANNER_LOCATION_MAGIC -29811

#define IS_UPDL_CMD(parse) \
((parse)->commandType == CMD_UPDATE || (parse)->commandType == CMD_DELETE)

typedef struct Chunk Chunk;
typedef struct Hypertable Hypertable;
typedef struct TimescaleDBPrivate
Expand Down
42 changes: 23 additions & 19 deletions tsl/src/nodes/decompress_chunk/decompress_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ can_batch_sorted_merge(PlannerInfo *root, CompressionInfo *info, const Chunk *ch
* To save planning time, we therefore refrain from adding them.
*/
static Path *
make_chunk_sorted_path(PlannerInfo *root, RelOptInfo *chunk_rel, const Hypertable *ht, Index ht_relid,
Path *path, Path *compressed_path)
make_chunk_sorted_path(PlannerInfo *root, RelOptInfo *chunk_rel, const Hypertable *ht,
Index ht_relid, Path *path, Path *compressed_path)
{
if (root->query_pathkeys == NIL)
{
Expand Down Expand Up @@ -895,9 +895,11 @@ ts_decompress_chunk_generate_paths(PlannerInfo *root, RelOptInfo *chunk_rel, con
chunk_rel->rows = new_row_estimate;

create_compressed_scan_paths(root, compressed_rel, compression_info, &sort_info);
fprintf(stderr, "sortinfo: seqnum %d, pushdown %d, reverse %d, compressed pks:\n",
sort_info.needs_sequence_num, sort_info.can_pushdown_sort,
sort_info.reverse);
fprintf(stderr,
"sortinfo: seqnum %d, pushdown %d, reverse %d, compressed pks:\n",
sort_info.needs_sequence_num,
sort_info.can_pushdown_sort,
sort_info.reverse);
my_print(sort_info.required_compressed_pathkeys);

/* compute parent relids of the chunk and use it to filter paths*/
Expand Down Expand Up @@ -1154,21 +1156,23 @@ ts_decompress_chunk_generate_paths(PlannerInfo *root, RelOptInfo *chunk_rel, con
*/
if (path->pathkeys == NIL)
{
path = (Path *) create_append_path(root,
chunk_rel,
list_make2(path, uncompressed_path),
NIL /* partial paths */,
NIL, // path->pathkeys,
req_outer,
0,
false,
path->rows + uncompressed_path->rows);
path = (Path *) create_append_path(root,
chunk_rel,
list_make2(path, uncompressed_path),
NIL /* partial paths */,
NIL, // path->pathkeys,
req_outer,
0,
false,
path->rows + uncompressed_path->rows);
}
else
{
path = (Path *) create_merge_append_path(root, chunk_rel,
list_make2(path, uncompressed_path), path->pathkeys,
req_outer);
path = (Path *) create_merge_append_path(root,
chunk_rel,
list_make2(path, uncompressed_path),
path->pathkeys,
req_outer);
}
add_path(chunk_rel, path);
}
Expand Down Expand Up @@ -1262,8 +1266,8 @@ ts_decompress_chunk_generate_paths(PlannerInfo *root, RelOptInfo *chunk_rel, con

add_partial_path(chunk_rel, path);
}
/* the chunk_rel now owns the paths, remove them from the compressed_rel so they can't be
* freed if it's planned */
/* the chunk_rel now owns the paths, remove them from the compressed_rel so they can't
* be freed if it's planned */
compressed_rel->partial_pathlist = NIL;
}
/* Remove the compressed_rel from the simple_rel_array to prevent it from
Expand Down

0 comments on commit d18bef0

Please sign in to comment.