1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Add ability to compile against MariaDB with new cost model

If MariaDB defines MARIADB_NEW_COST_MODEL, then ha_mcs::scan_time()
has a different signature.
This commit is contained in:
Sergei Petrunia
2022-11-10 15:35:50 +03:00
committed by Roman Nozdrin
parent fa286826cb
commit 88295b01f5

View File

@ -118,6 +118,22 @@ class ha_mcs : public handler
return HA_MAX_REC_LENGTH;
}
#ifdef MARIADB_NEW_COST_MODEL
/** @brief
Called in test_quick_select to determine if indexes should be used.
*/
virtual IO_AND_CPU_COST scan_time() override
{
IO_AND_CPU_COST cost;
cost.io= 0.0;
/*
For now, assume all cost is CPU cost.
The numbers are also very inadequate for the new cost model.
*/
cost.cpu= (double)(stats.records + stats.deleted) / 20.0 + 10;
return cost;
}
#else
/** @brief
Called in test_quick_select to determine if indexes should be used.
*/
@ -125,6 +141,7 @@ class ha_mcs : public handler
{
return (double)(stats.records + stats.deleted) / 20.0 + 10;
}
#endif
/** @brief
Analyze table command.