1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #1922 from denis0x0D/MCOL-4685

MCOL-4685: Eliminate some irrelevant settings (uncompressed data and extents per file)
This commit is contained in:
Roman Nozdrin
2021-06-06 16:00:29 +03:00
committed by GitHub
23 changed files with 170 additions and 143 deletions

View File

@ -74,17 +74,13 @@ ColumnCommandJL::ColumnCommandJL(const pColScanStep& scan, vector<BRM::LBID_t> l
// @Bug 2889. Drop partition enhancement. Read FilesPerColumnPartition and ExtentsPerSegmentFile for use in RID calculation.
fFilesPerColumnPartition = DEFAULT_FILES_PER_COLUMN_PARTITION;
// MCOL-4685 remove the option to set more than 2 extents per file (ExtentsPreSegmentFile).
fExtentsPerSegmentFile = DEFAULT_EXTENTS_PER_SEGMENT_FILE;
config::Config* cf = config::Config::makeConfig();
string fpc = cf->getConfig("ExtentMap", "FilesPerColumnPartition");
if ( fpc.length() != 0 )
fFilesPerColumnPartition = cf->uFromText(fpc);
string epsf = cf->getConfig("ExtentMap", "ExtentsPerSegmentFile");
if ( epsf.length() != 0 )
fExtentsPerSegmentFile = cf->uFromText(epsf);
}
ColumnCommandJL::ColumnCommandJL(const pColStep& step)
@ -124,17 +120,13 @@ ColumnCommandJL::ColumnCommandJL(const pColStep& step)
// @Bug 2889. Drop partition enhancement. Read FilesPerColumnPartition and ExtentsPerSegmentFile for use in RID calculation.
fFilesPerColumnPartition = DEFAULT_FILES_PER_COLUMN_PARTITION;
// MCOL-4685 remove the option to set more than 2 extents per file (ExtentsPreSegmentFile).
fExtentsPerSegmentFile = DEFAULT_EXTENTS_PER_SEGMENT_FILE;
config::Config* cf = config::Config::makeConfig();
string fpc = cf->getConfig("ExtentMap", "FilesPerColumnPartition");
if ( fpc.length() != 0 )
fFilesPerColumnPartition = cf->uFromText(fpc);
string epsf = cf->getConfig("ExtentMap", "ExtentsPerSegmentFile");
if ( epsf.length() != 0 )
fExtentsPerSegmentFile = cf->uFromText(epsf);
}
ColumnCommandJL::~ColumnCommandJL()

View File

@ -123,7 +123,10 @@ private:
uint32_t dbroot;
static const unsigned DEFAULT_FILES_PER_COLUMN_PARTITION = 32;
static const unsigned DEFAULT_EXTENTS_PER_SEGMENT_FILE = 4;
public:
// MCOL-4685: remove the option to set more than 2 extents per file (ExtentsPreSegmentFile)
static const unsigned DEFAULT_EXTENTS_PER_SEGMENT_FILE = 2;
};
}

View File

@ -180,10 +180,8 @@ void TupleBPS::initializeConfigParms()
fNumThreads = 0;
config::Config* cf = config::Config::makeConfig();
string epsf = cf->getConfig("ExtentMap", "ExtentsPerSegmentFile");
if ( epsf.length() != 0 )
fExtentsPerSegFile = cf->uFromText(epsf);
fExtentsPerSegFile = DEFAULT_EXTENTS_PER_SEG_FILE;
if (fRequestSize >= fMaxOutstandingRequests)
fRequestSize = 1;

View File

@ -189,6 +189,11 @@ int parseCompressionComment ( std::string comment )
else
compressiontype = MAX_INT;
// MCOL-4685: ignore [COMMENT '[compression=0] option at table or column level (no error
// messages, just disregard);
if (compressiontype == 0)
compressiontype = 2;
return compressiontype;
}
@ -2321,7 +2326,10 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
int compressiontype = get_compression_type(thd);
if (compressiontype == 1) compressiontype = 2;
// MCOL-4685:
// remove the option to declare uncompressed columns (set infinidb_compression_type = 0).
if (compressiontype == 1 || compressiontype == 0)
compressiontype = 2;
//string tablecomment;
if (table_arg->s->comment.length > 0 )
@ -2330,8 +2338,14 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
compressiontype = parseCompressionComment( tablecomment );
}
if ( compressiontype == MAX_INT )
if (compressiontype == MAX_INT)
{
compressiontype = get_compression_type(thd);
// MCOL-4685:
// remove the option to declare uncompressed columns (set infinidb_compression_type = 0).
if (compressiontype == 0)
compressiontype = 2;
}
else if ( compressiontype < 0 )
{
string emsg = IDBErrorInfo::instance()->errorMsg(ERR_INVALID_COMPRESSION_TYPE);
@ -2644,17 +2658,20 @@ extern "C"
if ( thd->db.length )
db = thd->db.str;
// MCOL-4685:
// remove the option to declare uncompressed columns (set infinidb_compression_type = 0).
int compressiontype = get_compression_type(thd);
if (compressiontype == 1) compressiontype = 2;
if ( compressiontype == MAX_INT )
compressiontype = get_compression_type(thd);
//hdfs
if ((compressiontype == 0) && (useHdfs))
{
if (compressiontype == 1 || compressiontype == 0)
compressiontype = 2;
if (compressiontype == MAX_INT)
{
// MCOL-4685: remove the option to declare uncompressed columns (set
// infinidb_compression_type = 0).
compressiontype = get_compression_type(thd);
if (compressiontype == 0)
compressiontype = 2;
}
if (compressiontype == 1) compressiontype = 2;

View File

@ -21,7 +21,7 @@
#include "ha_mcs_sysvars.h"
const char* mcs_compression_type_names[] = {
"NO_COMPRESSION",
"UNUSED",
"SNAPPY",
NullS
};