In the function add_chunk_sorted_paths, we create sorted versions of the
decompress paths. We construct a sort node and place it on top of the
decompressed chunk to do this. However, the decompress chunk path will
be also added to the relation via add_path. This function can recycle
the provided path if better paths are already known. Therefore, we need
our own private copy for the sorted paths.
decompress_chunk_plan_create used get_actual_clauses to extract
RestrictInfo clauses and adds them as quals. This function is only
supposed to be used when none of the RestrictInfos are pseudoconstant
leading to an assertion failure when the query has pseudoconstant
quals.
Fixes#3241
Volatile functions that are in chunk's baserestrictinfo
list were not correctly handled when we inserted a
DecompressChunk node. This PR adds these quals as a filter
to the DecompressChunk node.
Fixes#2864
When a MergeAppendPath has children that do not produce sorted
output a Sort node will be injected during plan creation, those
plans would trigger an error about invalid child nodes in
ConstraintAwareAppend. This PR makes ConstraintAwareAppend handle
those plans correctly.
Fix order by queries on compressed hypertables that
have char segment by column.
The segment by var column for decompressed chunks should be
created after setting the typmod and collation ids. Otherwise, we
get failures with char datatypes while decompressing.
Fixes#1650