* fix(rowgroup): RGData now uses uint64_t counter for the fixed sizes columns data buf.
The buffer can utilize > 4GB RAM that is necessary for PM side join.
RGData ctor uses uint32_t allocating data buffer.
This fact causes implicit heap overflow.
* feat(bytestream,serdes): BS buffer size type is uint64_t
This necessary to handle 64bit RGData, that comes as
a separate patch. The pair of patches would allow to
have PM joins when SmallSide size > 4GB.
* feat(bytestream,serdes): Distribute BS buf size data type change to avoid implicit data type narrowing
* feat(rowgroup): this returns bits lost during cherry-pick. The bits lost caused the first RGData::serialize to crash a process
This is "productization" of an old code that would enable extent
elimination for dictionary columns.
This concrete patch enables it, fixes perfomance degradation (main
problem with old code) and also fixes incorrect behavior of cpimport.
This patch:
1. Properly processes situation when pm join result count is exceeded.
2. Adds session variable 'columnstore_max_pm_join_result_count` to control the limit.
This is attempt to make some part of the code more stable.
For some reason we can get a spurious nullptr for boost::shared_ptr
which cause an assert and abort.
In the joblist code, in addition to sending the lbid of the SCAN
column, we also send the corresponding lbid of the AUX column to PrimProc.
In the primitives processor code in PrimProc, we load the AUX column
block (8192 rows since the AUX column is implemented as a 1-byte
UNSIGNED TINYINT) into memory and then pass it down to the low-level
scanning (vectorized scanning as applicable) routine to build a non-Empty
mask for the block being processed to filter out DELETED rows based on
comparison of the AUX block row to the empty magic value for the AUX column.
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
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.
1. In BatchPrimitiveProcessorJL::countThisMsg(), exit early if the
return code from primproc is non-zero.
2. For statistical window functions (stddev/var), properly handle
the case when there is only one value for the calculation.
Removed uint128 from joblist/lbidlist.*
Another toString() method for wide-decimal that is EMPTY/NULL aware
Unified decimal processing in WF functions
Fixed a potential issue in EqualCompData::operator() for
wide-decimal processing
Fixed some signedness warnings
For now it consists of only:
using int128_t = __int128;
using uint128_t = unsigned __int128;
All new privitive data types should go into this file in the future.
Squashed commit of the following:
commit fe4cc375faf1588e30471062f78403e81229cd02
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Fri Nov 1 13:38:11 2019 -0400
Added some code comments to the new join code.
commit a7a82d093be4db3dfb44d33e4f514fd104b25f71
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Fri Nov 1 13:17:47 2019 -0400
Fixed an error down a path I think is unused.
commit 4e6c7c266a9aefd54c384ae2b466645770c81a5d
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Fri Nov 1 13:12:12 2019 -0400
std::atomic doesn't exist in C7, -> boost::atomic.
commit ed0996c3f4548fff0e19d43852d429ada1a72510
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Oct 16 12:47:32 2019 -0500
Addition to the previous fix (join dependency projection).
commit 97bb806be9211e4688893460437f539c46f3796f
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Tue Oct 15 15:22:09 2019 -0500
Found and fixed a bad mem access, which may have been there for 8 years.
commit d8b0432d2abd70f28de5276daad758c494e4b04b
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Tue Oct 15 14:04:48 2019 -0500
Minor optimization in some code I happened to look at.
commit b6ec8204bf71670c7a8882464289e700aa5f7e33
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Tue Oct 15 14:04:11 2019 -0500
Fixed a compiler warning.
commit 0bf3e5218f71d92460ddc88090e3af77ecf28c35
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Tue Oct 15 10:11:09 2019 -0500
Undid part of the previous commit.
commit 5dfa1d23980e245c77c1644015b553aa4bcdf908
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Mon Oct 14 18:00:21 2019 -0500
Proofread the diff vs base, added some comments, removed some debugging stuff.
commit 411fd955ebbae97ddab210a7b17fe5708538001d
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Fri Oct 11 13:55:39 2019 -0500
If a dev build (SKIP_OAM_INIT), made postConfigure exit before trying
to start the system, because that won't work.
commit 634b1b8a7340b55fcaee045fd6d00b3e3a9269fa
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Mon Sep 30 14:55:45 2019 -0500
Reduced crit section of BPP::addToJoiner a little.
commit 31f30c64dd95942f2c7a247cc81feaa5933c1a07
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Sep 18 11:09:27 2019 -0500
Checkpointing. make the add joiner stuff free tmp mem quickly.
commit 9b7e788690546af7ddc4c921a0ab441ee9a8df02
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Sep 18 10:38:57 2019 -0500
Checkpoint. Removed tmp hardcoding of bucket count.
commit fda4d8b7fb30d0431dc15e473042abb3d8121b19
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Sep 18 10:20:09 2019 -0500
Checkpoint. Adjusted unproductive loop wait time.
commit 7b9a67df7d192f240e9e558e6e66c7aa9f1e8687
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Sep 18 10:10:43 2019 -0500
Checkpointing add'l optimizations.
If we promote bpp::processorThreads / bucket count to a power of 2, we can
use a bitmask instead of a mod operation to decide a bucket.
Also, boosted utilization by not waiting for a bucket lock to become free.
There are likely more gains to be had there with a smarter strategy.
Maybe have each thread generate a random bucket access pattern to reduce
chance of collision. TBD.
commit abe7dab8661b5120f6ee268abc005dd66cd643e2
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Tue Sep 17 16:15:51 2019 -0500
Multithreaded PM hash table construction likely works here.
A couple more fixes.
- missed a mod after a hash in one place.
- Made the PoolAllocator thread safe (small degree of performance hit
there in threaded env). May need to circle back to the table
construction code to eliminate contention for the allocators instead.
commit ab308762fbd873dbf246a6d1574223087cd0d5f6
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Tue Sep 17 12:14:14 2019 -0500
Checkpointing. Did some initial testing, fixed a couple things.
Not done testing yet.
commit 3b161d74fa859edb8b5ba84bb905e586ac0586e6
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Tue Sep 17 11:24:55 2019 -0500
Checkpointing. First cut of multithreaded PM join table building.
Builds but is untested.
commit cb7e6e1c2761fc6c33b3b1c6b6cda488d7792bca
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Mon Sep 16 13:03:50 2019 -0500
Increase the STLPoolAllocator window size to reduce destruction time.
commit b0ddaaae71a0a4959ad15c87579d85ed88e17e1f
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Fri Sep 13 11:52:51 2019 -0500
Fixed a bug preventing parallel table loading. works now.
commit b87039604e312c1ddb88cdb226228b1c3addf018
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Thu Sep 12 22:04:15 2019 -0500
Checkpointing some experimental changes.
- Made the allocator type used by PM joins the STLPoolAllocator
- Changed the default chunk size used by STLPoolAlloc based on a few test
runs
- Made BPP-JL interleave the PM join data by join # to take advantage
of new locking env on PM.
- While I was at it, fixed MCOL-1758.
commit fd4b09cc383d2b96959a8e5ca490c940bacb3d37
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Thu Sep 12 16:03:30 2019 -0500
Speculative change. Row estimator was stopping at 20 extents.
Removed that limitation.
commit 7dcdd5b5455f9ac06121dd3cf1ba722150f3ee56
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Thu Sep 5 09:10:28 2019 -0500
Inlined some hot simpleallocator fcns.
commit 6d84daceecc5499f6286cf3468c118b8b1d28d8f
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Sep 4 17:02:29 2019 -0500
Some optimizations to PM hash table creation.
- made locks more granular.
- reduced logic per iteration when adding elements.
commit b20bf54ed97c5a0a88d414a4dd844a0afc2e27f3
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Sep 4 15:32:32 2019 -0500
Reduced granularity of djLock in PrimProc.
commit 6273a8f3c4c62b87ef91c77a829033426e38e4d4
Author: Patrick LeBlanc <patrick.leblanc@mariadb.com>
Date: Wed Sep 4 14:45:58 2019 -0500
Added a timer to PM hash table construction
signal USR1 will print cumulative wall time to stdout & reset the timer.
This does the following:
* Switch resource manager to a singleton which reduces the amount of
times the XML data is scanned and objects allocated.
* Make the I_S tables use the FE implementation of the system catalog
* Make the I_S.columnstore_columns table use the RID list cache
* Make the extentmap pre-allocate a vector instead of many small allocs