[MCOL-1089] Extent elimination for double datatype Created: 2017-12-08 Updated: 2022-11-05 Resolved: 2022-11-05 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | None |
| Fix Version/s: | Icebox |
| Type: | New Feature | Priority: | Major |
| Reporter: | Dipti Joshi (Inactive) | Assignee: | Todd Stoffel (Inactive) |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | Performance | ||
| Issue Links: |
|
||||||||
| Epic Link: | ColumnStore Performance Improvements | ||||||||
| Description |
|
Extent elimination for double datatype |
| Comments |
| Comment by Dipti Joshi (Inactive) [ 2017-12-08 ] | |||||||||||||||||||||||||||||||||||||||||||
|
The float/double is a problem because the binary representation is not in order (0.1 in binary is more than 1.0 for example). | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergey Zefirov [ 2021-03-26 ] | |||||||||||||||||||||||||||||||||||||||||||
|
The representation choosen for doubles is sign and magnitude - highest bit is a sign and then lower bit are magnitude in "unsigned" representation. https://en.wikipedia.org/wiki/Signed_number_representations#Signed_magnitude_representation There are two other representations there, one's and two's complement. The latter is used in signed integer representation. The one's complement can help us with doubles. Here's simple program that displays six floating point values, their representation as integers, transformation into one's complement form and final transformation into unsigned integers range:
It's output:
First thing to note that positive doubles can be ordered by integer comparison. For negative doubles it is not true directly. But we can apply simple transform (xor with mask derived from sign bit) and get ordering corrected. The transformation is valid for all normalized floating point values, because exponent is in higher bits than mantissa and exponent is corrected by addition of 2^ {1024}so that lowest exponent is represented as all zeroes and highest possible exponent is represented as all-but-one ones. Exceptions are denormalized values and NANs. So it is quite possible to use integer arithmetic to perform comparison operations on doubles. | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Todd Stoffel (Inactive) [ 2022-11-05 ] | |||||||||||||||||||||||||||||||||||||||||||
|
This item is being closed because it was well passed the expiration date with no activity. If you suspect this was done in error please create a new ticket. |