Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
6.1.1
-
None
Description
These two methods:
inline const uint8_t* Row::getStringPointer(uint32_t colIndex) const |
{
|
if (inStringTable(colIndex)) |
return strings->getPointer(*((uint64_t*) &data[offsets[colIndex]])); |
|
return &data[offsets[colIndex]]; |
}
|
inline uint32_t Row::getStringLength(uint32_t colIndex) const |
{
|
if (inStringTable(colIndex)) |
return strings->getStringLength(*((uint64_t*) &data[offsets[colIndex]])); |
|
return strnlen((char*) &data[offsets[colIndex]], getColumnWidth(colIndex)); |
}
|
test exactly the same condition isStringTable(colIndex). In 99% cases these two methods are used at the same time. Therefore, the condition is tested two times.
Also, under terms of MCOL-4691 we'll introduce a new VARCHAR in-memory format (length followed by the actual data) to avoid strnlen() calls. This will make this duplicate condition more complex.
In order to avoid duplicate code and double condition evaluation, let's do the following:
- Remove the above two methods
- Change getConstString() as follows:
inline utils::ConstString Row::getConstString(uint32_t colIndex) const { return inStringTable(colIndex) ? strings->getConstString(*((uint64_t*) &data[offsets[colIndex]])) : getShortConstString(colIndex); } - Change all the affected code to use getConstString() instead of the removed methods
Attachments
Issue Links
- blocks
-
MCOL-4691 Major Regression: Selects with aggregates 2x slower in 5.x than in 1.2 (due to collation support)
- Closed