6 Commits

Author SHA1 Message Date
Matvey Arye
c4efacdc92 Fix tests and function naming after rebase
Small fixup after rebase on the master branch. Fixes test
output and function naming (even test functions should
have the ts_ not the tsl_ prefix for exported C functions).
2019-10-29 19:02:58 -04:00
Matvey Arye
0f3e74215a Split segment meta min_max into two columns
This simplifies the code and the access to the min/max
metadata. Before we used a custom type, but now the min/max
are just the same type as the underlying column and stored as two
columns.

This also removes the custom type that was used before.
2019-10-29 19:02:58 -04:00
Joshua Lockerman
46b4a9d3c2 Fix tests
This commit contains all of the miscellaneous fixes needed to pass
pre-release tests. It:

1. Switches the custom type in tsl/tests/compression_segment_meta.sql
   to determine its alignment and pass-by-ref'ness based on what
   TIMESTAMPTZ has. This is needed due to the fact that 8-byte values
   are pass-by-val in 64-bit platforms and pas-by-ref on 32-bit.

2. Marks some variables that are only used for assertions as
   PG_USED_FOR_ASSERTS_ONLY
2019-10-29 19:02:58 -04:00
Matvey Arye
2bf97e452d Push down quals to segment meta columns
This commit pushes down quals or order_by columns to make
use of the SegmentMetaMinMax objects. Namely =,<,<=,>,>= quals
can now be pushed down.

We also remove filters from decompress node for quals that
have been pushed down and don't need a recheck.

This commit also changes tests to add more segment by and
order-by columns.

Finally, we rename segment meta accessor functions to be smaller
2019-10-29 19:02:58 -04:00
Matvey Arye
b4a7108492 Integrate segment meta into compression
This commit integrates the SegmentMetaMinMax into the
compression logic. It adds metadata columns to the compressed table
and correctly sets it upon compression.

We also fix several errors with datum detoasting in SegmentMetaMinMax
2019-10-29 19:02:58 -04:00
Matvey Arye
b9674600ae Add segment meta min/max
Add the type for min/max segment meta object. Segment metadata
objects keep metadata about data in segments (compressed rows).
The min/max variant keeps the min and max values inside the compressed
object. It will be used on compression order by columns to allow
queries that have quals on those columns to be able to exclude entire
segments if no uncompressed rows in the segment may match the qual.

We also add generalized infrastructure for datum serialization
/ deserialization for arbitrary types to and from memory as well
as binary strings.
2019-10-29 19:02:58 -04:00