1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4753 Performance problem in Typeless join

This commit is contained in:
Alexander Barkov
2021-06-09 09:56:20 +04:00
committed by Roman Nozdrin
parent c6d0b46bc6
commit b3d6f62964
5 changed files with 104 additions and 172 deletions

View File

@ -559,6 +559,14 @@ public:
inline uint64_t hash(uint32_t lastCol) const; // generates a hash for cols [0-lastCol]
inline uint64_t hash() const; // generates a hash for all cols
inline void colUpdateMariaDBHasher(datatypes::MariaDBHasher &hasher, uint32_t col) const;
inline void colUpdateMariaDBHasherTypeless(datatypes::MariaDBHasher &hasher, uint32_t col) const;
inline uint64_t hashTypeless(const std::vector<uint32_t>& keyCols) const
{
datatypes::MariaDBHasher h;
for (uint32_t i = 0; i < keyCols.size(); i++)
colUpdateMariaDBHasherTypeless(h, keyCols[i]);
return h.finalize();
}
bool equals(const Row&, uint32_t lastCol) const;
inline bool equals(const Row&) const;
@ -942,6 +950,38 @@ inline void Row::colUpdateMariaDBHasher(datatypes::MariaDBHasher &h, uint32_t co
}
inline void Row::colUpdateMariaDBHasherTypeless(datatypes::MariaDBHasher &h, uint32_t col) const
{
switch (getColType(col))
{
case datatypes::SystemCatalog::CHAR:
case datatypes::SystemCatalog::VARCHAR:
case datatypes::SystemCatalog::BLOB:
case datatypes::SystemCatalog::TEXT:
{
CHARSET_INFO *cs = getCharset(col);
h.add(cs, getConstString(col));
break;
}
default:
{
if (isUnsigned(col))
{
uint64_t tb = getUintField(col);
h.add(&my_charset_bin, (const char*) &tb, 8);
}
else
{
int64_t val = getIntField(col);
h.add(&my_charset_bin, (const char*) &val, 8);
}
break;
}
}
}
inline void Row::setStringField(const uint8_t* strdata, uint32_t length, uint32_t colIndex)
{
uint64_t offset;