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

1661 Commits

Author SHA1 Message Date
fcf8596089 Merge pull request #2403 from denis0x0D/MCOL-5109
[MCOL-5109] Make PPS as singleton
2022-06-21 16:17:05 +03:00
e8f83121d2 [MCOL-4778] Return if we have an error in push_down_init. 2022-06-21 00:06:25 +03:00
9a24934728 MCOL-4841 remove BOOST_BIND_GLOBAL_PLACEHOLDERS
drone has this defined on the command line
2022-06-14 16:16:38 -05:00
6d47529499 Merge branch 'develop' into MCOL-4841 2022-06-14 14:41:41 -05:00
d4cf894edc MCOL-4841 fix some compiler issues 2022-06-14 14:32:01 -05:00
61359119ad This reverts MCOL-5044 AKA FairThreadPool that breaks regr test002
This reverts commit e40c16bd56, reversing
changes made to 18e6b1d77b.
2022-06-10 14:17:59 +00:00
272246e9fa Merge branch 'develop' into MCOL-4841 2022-06-09 16:58:33 -05:00
e40c16bd56 Merge pull request #2404 from drrtuy/MCOL-5044-dev
MCOL-5044 FairThreadPool implementation
2022-06-09 22:23:52 +03:00
3b6449842f Merge branch 'develop' into MCOL-4841
# Conflicts:
#	exemgr/main.cpp
#	oam/etc/Columnstore.xml.singleserver
#	primitives/primproc/primproc.cpp
2022-06-09 10:07:26 -05:00
467fe0b401 [MCOL-5109] Make a singleton from ServicePrimProc.
This patch makes a singleton from ServicePrimProc.
2022-06-07 13:27:45 +03:00
c5fa27475d Welford algorithm for STD and VAR
Naive algorithm for calculating STD and VAR is subject to catastrophic
cancellation. A well-known Welford's algorithms is used instead.
2022-06-03 15:29:30 +03:00
fd8ba33f21 MCOL-5044 This patch replaces PriorityThreadPool with FairThreadPool that uses a simple
operations + morsel size weight model to equally allocate CPU b/w parallel query morsels.
This patch delivers better parallel query timings distribution(timings graph resembles normal
distribution with a bigger left side thus more queries runs faster comparing with PrioThreadPool-based
single-node installation).
See changes in batchprimitiveprocessor-jl.h and comments in fair_threadpool.h for
important implementation details
2022-06-03 10:08:12 +00:00
f29d5e7869 MCOL-4912 This patch adds some forgotten MDB functions 2022-05-27 16:27:07 +00:00
e147184b8d MCOL-5065: return values of getSystemReady/getSystemQueryReady should be > 0 (#2354) 2022-05-10 12:32:17 -05:00
4c26e4f960 MCOL-4912 This patch introduces Extent Map index to improve EM scaleability
EM scaleability project has two parts: phase1 and phase2.
        This is phase1 that brings EM index to speed up(from O(n) down
        to the speed of boost::unordered_map) EM lookups looking for
        <dbroot, oid, partition> tuple to turn it into LBID,
        e.g. most bulk insertion meta info operations.
        The basis is boost::shared_managed_object where EMIndex is
        stored. Whilst it is not debug-friendly it allows to put a
        nested structs into shmem. EMIndex has 3 tiers. Top down description:
        vector of dbroots, map of oids to partition vectors, partition
        vectors that have EM indices.
        Separate EM methods now queries index before they do EM run.
        EMIndex has a separate shmem file with the fixed id
        MCS-shm-00060001.
2022-05-04 12:59:16 +00:00
bbb168a846 Mcol 4560 (#2337)
* MCOL-4560 remove unused xml entries and code that references it.
There is reader code and variables for some of these settings, but nobody uses them.
2022-04-18 18:00:17 -04:00
e174696351 MCOL-5001 This patch merges ExeMgr and PrimProc runtimes
EM and PP are most resource-hungry runtimes.
        The merge enables to control their cummulative
        resource consumption, thread allocation + enables
        zero-copy data exchange b/w local EM and PP facilities.
2022-04-04 11:46:33 +00:00
f28e00c206 No repeating code in client_udfs + better test 2022-03-28 21:48:47 +03:00
8d31478b72 Added mcsUDFs to install.sh+removed nonexistent fn 2022-03-28 21:48:47 +03:00
749b8f16ee Added mcs-named UDFs to cpp 2022-03-28 21:48:46 +03:00
65252df4f6 C++20 fixes 2022-03-28 12:32:29 +00:00
29679e91ec Clang warnfixes (#2310) 2022-03-21 13:19:55 -05:00
53b9a2a0f9 MCOL-4580 extent elimination for dictionary-based text/varchar types
The idea is relatively simple - encode prefixes of collated strings as
integers and use them to compute extents' ranges. Then we can eliminate
extents with strings.

The actual patch does have all the code there but miss one important
step: we do not keep collation index, we keep charset index. Because of
this, some of the tests in the bugfix suite fail and thus main
functionality is turned off.

The reason of this patch to be put into PR at all is that it contains
changes that made CHAR/VARCHAR columns unsigned. This change is needed in
vectorization work.
2022-03-02 23:53:39 +03:00
b5ccd52c09 OpenSSL 3 support for Columnstore 2022-02-18 14:07:23 +00:00
3919c541ac New warnfixes (#2254)
* Fix clang warnings

* Remove vim tab guides

* initialize variables

* 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length

* Fix ISO C++17 does not allow 'register' storage class specifier for outdated bison

* chars are unsigned on ARM, having  if (ival < 0) always false

* chars are unsigned by default on ARM and comparison with -1 if always true
2022-02-17 13:08:58 +03:00
15a87ee510 Merge pull request #2257 from tntnatbry/MCOL-4957
MCOL-4957 Fix performance slowdown for processing TIMESTAMP columns.
2022-02-16 19:46:57 +02:00
9b686c04e1 wrong return type 2022-02-15 14:23:08 +00:00
973e5024d8 MCOL-4957 Fix performance slowdown for processing TIMESTAMP columns.
Part 1:
 As part of MCOL-3776 to address synchronization issue while accessing
 the fTimeZone member of the Func class, mutex locks were added to the
 accessor and mutator methods. However, this slows down processing
 of TIMESTAMP columns in PrimProc significantly as all threads across
 all concurrently running queries would serialize on the mutex. This
 is because PrimProc only has a single global object for the functor
 class (class derived from Func in utils/funcexp/functor.h) for a given
 function name. To fix this problem:

   (1) We remove the fTimeZone as a member of the Func derived classes
   (hence removing the mutexes) and instead use the fOperationType
   member of the FunctionColumn class to propagate the timezone values
   down to the individual functor processing functions such as
   FunctionColumn::getStrVal(), FunctionColumn::getIntVal(), etc.

   (2) To achieve (1), a timezone member is added to the
   execplan::CalpontSystemCatalog::ColType class.

Part 2:
 Several functors in the Funcexp code call dataconvert::gmtSecToMySQLTime()
 and dataconvert::mySQLTimeToGmtSec() functions for conversion between seconds
 since unix epoch and broken-down representation. These functions in turn call
 the C library function localtime_r() which currently has a known bug of holding
 a global lock via a call to __tz_convert. This significantly reduces performance
 in multi-threaded applications where multiple threads concurrently call
 localtime_r(). More details on the bug:
   https://sourceware.org/bugzilla/show_bug.cgi?id=16145

 This bug in localtime_r() caused processing of the Functors in PrimProc to
 slowdown significantly since a query execution causes Functors code to be
 processed in a multi-threaded manner.

 As a fix, we remove the calls to localtime_r() from gmtSecToMySQLTime()
 and mySQLTimeToGmtSec() by performing the timezone-to-offset conversion
 (done in dataconvert::timeZoneToOffset()) during the execution plan
 creation in the plugin. Note that localtime_r() is only called when the
 time_zone system variable is set to "SYSTEM".

 This fix also required changing the timezone type from a std::string to
 a long across the system.
2022-02-14 14:12:27 -05:00
27dea733c5 MCOL4841 dev port run large join without OOM 2022-02-09 17:33:55 -06:00
04752ec546 clang format apply 2022-01-21 16:43:49 +00:00
6b6411229f build fixes 2022-01-21 16:34:04 +00:00
01f3ceb437 replace header guards with #pragma once 2022-01-21 15:24:58 +00:00
7cfcdf365d Merge pull request #2211 from drrtuy/MCOL-4899-dev
MCOL-4899 MCS now applies a correct collation running IN for characte…
2022-01-06 21:08:11 +03:00
05897948e4 MCOL-4899 MCS now applies a correct collation running IN for character data types 2022-01-05 12:00:01 +00:00
195425924d MCOL-4936 Disable binlog for DML statements.
DML statements executed on the primary node in a ColumnStore
cluster do not need to be written to the primary's binlog. This
is due to ColumnStore's distributed storage architecture.

With this patch, we disable writing to binlog when a DML statement
(INSERT/DELETE/UPDATE/LDI/INSERT..SELECT) is performed on a ColumnStore
table. HANDLER::external_lock() calls are used to
  1. Turn OFF the OPTION_BIN_LOG flag
  2. Turn ON the OPTION_BIN_TMP_LOG_OFF flag
in THD::variables.option_bits during a WRITE lock call.

THD::variables.option_bits is restored back to the original state
during the UNLOCK call in HANDLER::external_lock().

Further, isDMLStatement() function is added to reduce code verbosity
to check if a given statement is a DML statement.

Note that with this patch, not writing to primary's binlog means
DML replication from a ColumnStore cluster to another ColumnStore
cluster or to another foreign engine will not work.
2022-01-04 17:31:59 +00:00
b3ab3fb514 Merge pull request #2203 from mariadb-AlexeyAntipovsky/auto-query-stats
[MCOL-4944] Automatically enable stats collection
2021-12-23 15:13:43 +03:00
94806e7ee0 Merge pull request #2200 from drrtuy/MCOL-4943-dev
MCOL-4943 Moved SQL script call into columnstore-post-install
2021-12-21 11:18:07 +03:00
683a6b3d19 [MCOL-4944] Automatically enable stats collection
if it is enabled in the config
2021-12-21 11:15:25 +03:00
22b0e4addc MCOL-4943 Moved SQL script call into columnstore-post-install 2021-12-18 03:59:58 +00:00
7b5845a4aa MCOL-4871 Bar's patch to do proper extent elimination for short CHAR 2021-12-17 17:41:03 +00:00
7f456e58cc MCOL-4868 UPDATE on a ColumnStore table containing an IN-subquery
on a non-ColumnStore table does not work.

As part of MCOL-4617, we moved the in-to-exists predicate creation
and injection from the server into the engine. However, when query
with an IN Subquery contains a non-ColumnStore table, the server
still performs the in-to-exists predicate transformation for the
foreign engine table. This caused ColumnStore's execution plan to
contain incorrect WHERE predicates. As a fix, we call
mutate_optimizer_flags() for the WRITE lock, in addition to the READ
table lock. And in mutate_optimizer_flags(), we change the optimizer
flag from OPTIMIZER_SWITCH_IN_TO_EXISTS to OPTIMIZER_SWITCH_MATERIALIZATION.
2021-12-16 23:11:26 +00:00
af36f9940f This patch introduces support for scanning/filtering vectorized execution for numeric-based
data types TEXT, CHAR, VARCHAR, FLOAT and DOUBLE are not yet supported by vectorized path
This patch introduces an example for Google benchmarking suite to measure a perf diff
b/w legacy scan/filtering code and the templated version
2021-12-10 10:30:00 +00:00
340a90fc8d MCOL-4874 Crossengine JOIN involving a ColumnStore table and a
wide decimal column in a non-ColumnStore table throws an exception.

ROW::getSignedNullValue() method does not support wide decimal fields
yet. To fix this exception, we remove the call to this method from
CrossEngineStep::setField().
2021-12-08 22:26:52 +00:00
d91cab2ff5 MCOL-4925 Suppress the warning message when a non-cached table is (#2164)
dropped with the insert cache enabled.
2021-12-06 11:27:37 -06:00
6f1c0d6c5a Merge pull request #2157 from denis0x0D/warnings
[MCOL-4849] Fix build warnings.
2021-11-25 12:14:07 -06:00
affb2ae770 MCOL-4769 Fix cache bugs. (#2151)
* MCOL-4769 Do not replay INSERTs and LDIs on the replica nodes when
the write cache is enabled.

* MCOL-4769 If a table is created with the write cache disabled
(i.e. when columnstore_cache_inserts=OFF), make it accessible when
the cache feature is enabled (columnstore_cache_inserts=ON).
2021-11-22 14:20:50 -06:00
f8bd566b0f [MCOL-4849] Fix build warnings. 2021-11-17 17:33:22 +03:00
b382f681a1 [MCOL-4849] Parallelize the processing of the bytestream vector.
This patch changes the logic of the `receiveMultiPrimitiveMessages`
function in the following way:

1. We have only one aggregation thread which reads the data from Queue (which is populated
by messages from BPPs).
2. Processing of the received `bytestream vector` could be in parallel depends on the
type of `TupleBPS` operation (join, fe2, ...) and actual thread pool workload.

The motivation is to eliminate some amount of context switches.
2021-11-04 13:28:22 +03:00
6a00fa9839 byson unused function fix 2021-10-29 14:57:11 +00:00
1973168e03 c++17 fix 2021-10-29 14:57:11 +00:00