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

1013 Commits

Author SHA1 Message Date
362bfcd15e MCOL-4361 Replace pow(10.0, (double)scale) expressions with a static dictionary lookup. 2021-04-09 12:41:04 +04:00
dfa9657f2e MCOL-4589 Follow up on MCOL-4543 to optimize out non-referenced
columns from a subquery involving UNIONs.
2021-03-29 12:07:36 +00:00
8a03e6c7d1 MCOL-4543 Subquery optimization.
For a query of the form:

SELECT COUNT(c2) FROM (SELECT * FROM t1) q;

where t1 contains 10 columns c1, c2, ... , c10.

We currently create an intermediate RowGroup in ExeMgr with
a row of the form (1, c2_value1, 1, 1, 1, 1, 1, 1, 1, 1), i.e.
for all the columns of the subquery which are not referenced in
the outer query, we substitute a constant value, which is wasteful.

With this optimization, we are trimming the RowGroup to a row
of the form (1, c2_value1). This can have non-trivial query
execution time improvements if the subquery contains large number
of columns (such as a "select *" on a very wide table) and the outer
query is only referencing a subset of these columns with lower
index values from the subquery (as an example, c1 or c2 above).
That is, the current limitation of this optimization is we are not
removing those non-referenced subquery columns (c1 in the query above)
which are to the left of a referenced column.
2021-03-29 11:56:04 +00:00
0643125426 Update columnstore usage of select_lex
After the cleanup work done for FETCH FIRST ... WITH TIES
SELECT_LEX members select_limit, explicit_limit and offset_limit are now moved
to SELECT_LEX::limit_params.
2021-03-28 16:07:32 +03:00
907e99cf20 changes to match upmerge from 10.4 2021-02-17 17:11:47 +00:00
229fd5d1bd Merge pull request #1756 from benthompson15/MCOL-4193-dev
MCOL-4193-dev
2021-02-12 22:41:29 +03:00
846f7fb29b MCOL-4193: Delete unused OAM and applications, ProcMon, ProcMgr, and no longer build all tools for packages 2021-02-08 17:51:09 -06:00
222b214287 Merge pull request #1750 from tntnatbry/MCOL-4515-develop
MCOL-4515 Binlog replication to CS slave hangs for INSERT .. SELECT query on master.
2021-02-08 16:27:37 +03:00
049d60f1cf Merge pull request #1749 from tntnatbry/MCOL-4493-develop
MCOL 4493
2021-02-05 12:19:32 +03:00
abf45bf46c MCOL-4493 Add ON expressions for WHERE processing when the JOIN
type is not LEFT/RIGHT.

In buildOuterJoin(), do not add ON expressions for WHERE
processing when the JOIN type is not LEFT/RIGHT.

Test cases to check correct processing of INNER JOIN ON expressions
with possible/impossible WHERE conditions are added for
  1. One side of the LEFT JOIN being INNER JOIN.
  2. One side of the LEFT JOIN being an INNER JOIN inside an INNER JOIN.
  3. Both sides of the LEFT JOIN being an INNER JOIN.
2021-02-05 09:10:38 +00:00
3096edc1d3 MCOL-3785 wrap names of db, table & columns in "`" 2021-02-04 11:40:14 +03:00
bdd0963ea3 MCOL-4515 Binlog replication to CS slave hangs for INSERT .. SELECT query on master.
An INSERT .. SELECT performed on a master node caused an infinite
loop on the slave node with columnstore_replication_slave=OFF.

The issue was ha_mcs_impl_select_next() was returning 0 if
the executing thread is a slave and returning early to avoid DML
execution on the slave. The calling code in select_handler::execute()
ran into an infinite loop due to this as it checked the return code
of the function as 0, and incorrectly thought there are more rows
to process.

The fix is to return HA_ERR_END_OF_FILE as the return value,
instead of 0. This is for the case of the query running on the
slave node with columnstore_replication_slave=OFF.
2021-02-04 06:35:00 +00:00
abbe2ebbf6 Dynamic version numbering 2021-01-21 10:30:46 +00:00
0b6dbcd4a8 MCOL-4456 Fix for bulk insertion of BLOBs 2021-01-20 11:27:56 +00:00
8206fafb7c MCOL-4496 Upmerged the commit 7fa5ca3a6 to generalise CHAR|VARCHAR|TEXT|BLOB
bulk insertion processing and fix the original issue introduced by MCOL-2000
2021-01-19 13:25:06 +00:00
b0f97611fc Merge pull request #1691 from drrtuy/MCOL-4465_MCOL-4466_MCOL-4452
Mcol 4465 mcol 4466 mcol 4452
2020-12-23 16:28:40 +03:00
994d9a5125 MCOL-4465 Use a proper ColType for UDAF in a projection RowGroup 2020-12-23 10:32:11 +00:00
bfe90be3db Merge pull request #1677 from tntnatbry/MCOL-4177-2
MCOL-4177 Add support for bulk insertion for wide decimals.
2020-12-18 12:37:23 +03:00
d35002fb65 MCOL-4263 return int for func_floor on datetime
For TIMESTAMP, it should do similar. However, it didn't work. For some reason, MDB has the function set as DATETIME, which for cs, isn't the same thing. Added a kludge to ha_mcs_execplan.cpp to handle it.
2020-12-16 16:23:21 -06:00
f6b55c1e18 MCOL-4177 Add support for bulk insertion for wide decimals.
1. This patch adds support for wide decimals with/without scale
     to cpimport. In addition, INSERT ... SELECT and LDI are also
     now supported.
  2. Logic to compute the number of bytes to convert a binary
     representation in the buffer to a narrow decimal is also
     simplified.
2020-12-15 22:14:54 +00:00
b1d1ad1486 MCOL-2000 Fix CREATE TABLE syntax
for a generated replacement statements of original statements:
* `CREATE TABLE .. LIKE ..`
* `ALTER TABLE .. ENGINE=Columnstore`
* `CREATE TABLE .. AS ..`
2020-12-07 18:12:25 +03:00
d2e7c9d98d MCOL-2000 Process charset definitions in the DDL
MCOL-2000 Process charset definitions in the ALTER TABLE .. ADD COLUMN

MCOL-2000 Yet another fixes for column charsets

* make respect for column (including table/db/server default) charsets
  for the TEXT(n) fields
* round TEXT(n) column length up to the next default length of TEXT-like
  subtypes, 255 (TINYTEXT), 65535 (TEXT) and so on up to 2100000000
  (LONGTEXT)
2020-12-04 15:01:01 +03:00
4319dcf89f Merge pull request #1628 from dhall-MariaDB/MCOL-4105-dev
MCOL-4105 dev skip calpontsys tables
2020-12-01 13:10:13 -06:00
611ad780ef MCOL-4105 dev skip calpontsys tables
Procedure columnstore_upgrade trips table comments. This is not allowed for calpontsys tables.
2020-12-01 09:57:01 -06:00
a159f8a0b6 MCOL-4188 Regression fixes for MCOL-641.
1. Add wide decimal support to AggregateColumn::evaluate
and TreeNode::getDecimalVal().
2. Use the pm aggregate attributes to determine um aggregate
attributes in TupleAggregateStep::prep2PhasesAggregate.
2020-11-30 13:49:05 -05:00
494bde61e1 MCOL-4409 Moved static Decimal conversion methods into VDecimal class
MCOL-4409 This patch combines VDecimal and Decimal and makes
IDB_Decimal an alias for the result class

MCOL-4409 More boilerplate reduction in Func_mod

Removed couple TSInt128::toType() methods
2020-11-30 12:08:52 +00:00
2ea73846b9 MCOL-4422 Remove mariadb.h and my_sys.h dependency from collation.h 2020-11-30 14:26:35 +04:00
61b55127ac A fix for MCOL-4174 Review/refactor frontend/connector code
- The code in ha_mcs_partition.cpp erroneously printed data
  to a temporary ostringstream "oss" instead of "output".

- The left-side adjustfield (applied when printing the range values)
  unintentionally disappeared during MCOL-4174 refactoring.
  Restoring left adjustfield in TypeHandler::PrintPartitionValue*().
2020-11-20 10:23:13 +04:00
8603c8f780 Merge pull request #1606 from dhall-MariaDB/MCOL-4397-dev
MCOL-4397 dev call refreshShm() for calshowpartitions
2020-11-19 17:02:25 -05:00
f742a55cd6 MCOL-4397 dev call refreshShm() for calshowpartitions 2020-11-19 13:49:10 -06:00
31e0909552 Merge for 13264feb7 that is the fix for multiple LDI issues described in MCOL-4320/4364/4370 2020-11-18 13:53:16 +00:00
58495d0d2f MCOL-4387 Convert dataconvert::decimalToString() into VDecimal and TSInt128 methods 2020-11-18 13:53:16 +00:00
d5c6645ba1 Adding mcs_basic_types.h
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.
2020-11-18 13:53:15 +00:00
129d5b5a0f MCOL-4174 Review/refactor frontend/connector code 2020-11-18 13:53:15 +00:00
1f4a781704 MCOL-641 Fixes for arithmetic operations.
1. Perform type promotion to wide decimal if the result
   of an arithmetic operation has a precision > 18.
2. Only set the decimal width of an arithmetic operation to wide
   if both the LHS and RHS of the operation are decimal types.
2020-11-18 13:52:20 +00:00
8de9764f84 MCOL-4172 Add support for wide-DECIMAL into statistical aggregate and regr_* UDAF functions
The patch fixes wrong results returned when multiple UDAF exist in projection

aggregate over wide decimal literals now works
2020-11-18 13:52:20 +00:00
62c1c1e0e2 Remove hi_val/lo_val data members from EMCasualPartition_struct
and use the union members instead.
2020-11-18 13:52:19 +00:00
638202417f MCOL-4171 2020-11-18 13:52:19 +00:00
d3bc68b02f MCOL-641 Refactor initial extent elimination support.
This commit also adds support in TupleHashJoinStep::forwardCPData,
although we currently do not support wide decimals as join keys.

Row estimation to determine large-side of the join is also updated.
2020-11-18 13:52:19 +00:00
6aea838360 MCOL-641 Add support for functions (Part 2). 2020-11-18 13:51:55 +00:00
e88cbe9bc1 MCOL-641 Simple aggregates support: min, max, sum, avg for wide-DECIMALs. 2020-11-18 13:51:25 +00:00
3d94ec1568 MCOL-641 Followup on functions commit. 2020-11-18 13:51:25 +00:00
cfe35b5c7f MCOL-641 Add support for functions (Part 1). 2020-11-18 13:51:25 +00:00
554c6da8e8 MCOL-641 Implement int128_t versions of arithmetic operations and add unit test cases. 2020-11-18 13:47:45 +00:00
b5534eb847 MCOL-641 Refactored MultiplicationOverflowCheck but it still has flaws.
Introduced fDecimalOverflowCheck to enable/disable overflow check.

Add support into a FunctionColumn.

Low level scanning crashes on medium sized data sets.
2020-11-18 13:47:45 +00:00
74b64eb4f1 MCOL-641 1. Add support for int128_t in ParsedColumnFilter.
2. Set Decimal precision in SimpleColumn::evaluate().
3. Add support for int128_t in ConstantColumn.
4. Set IDB_Decimal::s128Value in buildDecimalColumn().
5. Use width 16 as first if predicate for branching based on decimal width.
2020-11-18 13:47:45 +00:00
0bd172cd6e MCOL-641 The fix to support recent changes in 10.5.1. 2020-11-18 13:47:44 +00:00
2e8e7d52c3 Renamed datatypes/decimal.* into csdecimal to avoid collision with MDB. 2020-11-18 13:47:44 +00:00
238386bf63 MCOL-641 Replaced IDB_Decima.__v union with int128_t attribute.
Moved all tests into ./test

Introduced ./datatypes directory
2020-11-18 13:47:44 +00:00
824615a55b MCOL-641 Refactor empty value implementation in writeengine. 2020-11-18 13:47:44 +00:00