summaryrefslogtreecommitdiff
path: root/sql/partition_info.h
Commit message (Collapse)AuthorAgeFilesLines
* Compilation fixbb-10.5-6915-extAleksey Midenkov2020-04-271-0/+2
|
* MDEV-22155 ALTER add default history partitions name clash on non-default ↵Aleksey Midenkov2020-04-271-0/+46
| | | | | | | partitions If any of default names clashes with existing names find next large enough name gap for the requested number of partitions.
* Revert "MDEV-17554 Auto-create new partition for system versioned tables ↵Sergei Golubchik2020-02-271-38/+3
| | | | | | | with history partitioned by INTERVAL/LIMIT" This reverts commit 9894751a2a61ef952ac6ac556fd683e53fc150e2. This reverts commit f707c83fff4fa3f5291684e6226542fdb75bbdeb.
* MDEV-17554 Auto-create new partition for system versioned tables with ↵Aleksey Midenkov2020-02-251-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | history partitioned by INTERVAL/LIMIT When there are E empty partitions left, auto-create N new empty partitions for SYSTEM_TIME partitioning rotated by INTERVAL/LIMIT and marked by AUTO_INCREMENT keyword. Syntax change: AUTO_INCREMENT keyword (or shorter AUTO may be used instead) after LIMIT/INTERVAL clause. CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 100000 AUTO_INCREMENT; CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK AUTO_INCREMENT; The current revision implements hard-coded values of 1 for E and N. As well as auto-creation threshold MinInterval = 1 hour, MinLimit = 1000. The name for newly added partition will be first chosen as "pX", where X is partition number and "p" is hard-coded name prefix. If this name is already occupied, the X will be incremented until the resulting name will be free to use. ALTER TABLE ADD PARTITION is now always fast. If there some history partition overflow occurs manual ALTER TABLE REBUILD PARTITION is needed.
* MDEV-17554 history partitioning cleanupsAleksey Midenkov2019-12-031-4/+59
| | | | | | | * Fixed missed warning on condition boundary * REORGANIZE cases * vers_utils.h removed * test cases cleanup
* MDEV-17553 Enable setting start datetime for interval partitioned history of ↵Aleksey Midenkov2019-11-071-21/+3
| | | | | | | | | | | | | | | | | | | | | | | system versioned tables * Explicit STARTS syntax * SHOW CREATE * Default STARTS rounding depending on INTERVAL type * Warn when STARTS timestamp is later than query time * Fix uninitialized Lex->create_last_non_select_table under mysql_unpack_partition() Default STARTS rounding depending on INTERVAL type If STARTS clause is omitted, default one is assigned with value derived from query timestamp. The rounding is done on STARTS value depending on INTERVAL type: SECOND: no rounding is done; MINUTE: timestamp seconds is set to 0; HOUR: timestamp seconds and minutes are set to 0; DAY, WEEK, MONTH and YEAR: timestamp seconds, minutes and hours are set to 0 (the date of rotation is kept as current date).
* Merge branch '10.3' into 10.4Oleksandr Byelkin2019-09-021-4/+3
|\
| * MDEV-18501 Partition pruning doesn't work for historical queries (refactoring)Aleksey Midenkov2019-09-011-2/+2
| | | | | | | | | | | | | | | | | | SYSTEM_TYPE partitioning: COLUMN properties removed. Partitioning is now pure RANGE based on UNIX_TIMESTAMP(row_end). DECIMAL type is now allowed as RANGE partitioning, we can partition by UNIX_TIMESTAMP() (but not for DATETIME which depends on local timezone of course).
| * MDEV-18501 Partition pruning doesn't work for historical queries (cleanup)Aleksey Midenkov2019-09-011-2/+1
| | | | | | | | Cleanup removes useless allocation.
* | Merge 10.3 into 10.4Marko Mäkelä2019-05-221-1/+10
|\ \ | |/
| * MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_argumentsAleksey Midenkov2019-05-201-2/+12
| | | | | | | | [Closes tempesta-tech/mariadb#572]
* | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | |\
| | | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
* | | | | Merge 10.3 into 10.4Marko Mäkelä2018-12-121-0/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2018-12-121-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2018-12-121-0/+1
| | |\ \ \ | | | |/ /
| | | * | Merge 10.0 into 10.1Marko Mäkelä2018-12-121-0/+1
| | | |\ \
| | | | * | MDEV-17032: Estimates are higher for partitions of a table with ↵Varun Gupta2018-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @@use_stat_tables= PREFERABLY The problem here is EITS statistics does not calculate statistics for the partitions of the table. So a temporary solution would be to not read EITS statistics for partitioned tables. Also disabling reading of EITS for columns that participate in the partition list of a table.
* | | | | | MDEV-17317 Add THD* parameter into Item::get_date() and stricter data type ↵Alexander Barkov2018-09-281-2/+3
|/ / / / / | | | | | | | | | | | | | | | control to "fuzzydate"
* | | | | dead code - related to vtmdSergei Golubchik2018-04-101-1/+0
| | | | | | | | | | | | | | | | | | | | (will be added back when it'll be used)
* | | | | PARTITION BY SYSTEM_TIME INTERVAL ...Sergei Golubchik2018-02-231-155/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lots of changes: * calculate the current history partition in ::external_lock(), not in ::write_row() or ::update_row() * remove dynamically collected per-partition row_end stats * no full table scan in open_table_from_share to calculate these stats, no manual MDL/thr_locks in open_table_from_share * no shared stats in TABLE_SHARE = no mutexes or condition waits when calculating current history partition * always compare timestamps, don't convert them to MYSQL_TIME (avoid DST ambiguity, and it's faster too) * correct interval handling, 1 month = 1 month, not 30 * 24 * 3600 seconds * save/restore first partition start time, and count intervals from there * only allow to drop first partitions if INTERVAL * when adding new history partitions, split the data in the last history parition, if it was overflowed * show partition boundaries in INFORMATION_SCHEMA.PARTITIONS
* | | | | cleanup: partition_info::check_constantsSergei Golubchik2018-02-231-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partition_info had a bunch of function pointers to avoid if()'s when invoking part_type specific functionality (like get_part_id, etc). But check_range_constants() and check_list_constants() were still invoked conditionally, with if()'s. Create partition_info::check_constants function pointer, get rid of if()'s Also remove alloc argument of check_range_constants(), added in 26a3ff0a22e. Broken system versioning will be fixed in following commits.
* | | | | Vers SQL: partition rotation by INTERVAL fixAleksey Midenkov2018-02-231-2/+3
| | | | | | | | | | | | | | | | | | | | Update partition stats on ha_partition::write_row()
* | | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | | MDEV-11084 Select statement with partition selection against MyISAM table ↵Alexey Botchkov2018-01-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | opens all partitions. Now we don't open partitions if it was explicitly cpecified. ha_partition::m_opened_partition bitmap added to track partitions that were actually opened.
* | | | | compilation warning on windowsSergei Golubchik2018-01-171-3/+3
| | | | |
* | | | | MDEV-14923 Assertion upon INSERT into locked versioned partitioned tableAleksey Midenkov2018-01-131-1/+1
| | | | |
* | | | | System Versioning 1.0 pre8Aleksey Midenkov2018-01-101-22/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Merge branch '10.3' into trunk
| * \ \ \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-011-0/+1
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/make_dist.cmake.in mysql-test/r/func_json.result mysql-test/r/ps.result mysql-test/t/func_json.test mysql-test/t/ps.test sql/item_cmpfunc.h
| | * | | | Merge remote-tracking branch 'origin/10.1' into 10.2Vicențiu Ciorbaru2017-12-221-0/+1
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-12-201-0/+1
| | | |\ \ \ | | | | |/ /
| | | | * | Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2017-12-201-0/+1
| | | | |\ \ | | | | | |/
| | | | | * MDEV-13788 Server crash when issuing bad SQL partition syntaxAlexander Barkov2017-11-201-0/+1
| | | | | |
* | | | | | MDEV-14821 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())` ↵Eugene Kosov2018-01-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | failed in Diagnostics_area::set_ok_status
* | | | | | Partition: uninitialized vers_info fixAleksey Midenkov2017-12-221-1/+1
| | | | | |
* | | | | | Timestamp-based versioning for InnoDB [closes #209]Aleksey Midenkov2017-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Removed integer_fields check * Reworked Vers_parse_info::check_sys_fields() * Misc renames * versioned as vers_sys_type_t * Removed versioned_by_sql(), versioned_by_engine() versioned() works as before; versioned(VERS_TIMESTAMP) is versioned_by_sql(); versioned(VERS_TRX_ID) is versioned_by_engine(). * create_tmp_table() fix * Foreign constraints for timestamp-based * Range auto-specifier fix * SQL: 1-row partition rotation fix [fixes #260] * Fix 'drop system versioning, algorithm=inplace'
* | | | | | Partitioning syntax for versioningSergei Golubchik2017-12-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partition by system_time ( partition p0 history, partition pn current )
* | | | | | fix win32 warningsEugene Kosov2017-11-131-1/+1
| | | | | |
* | | | | | System Versioning pre0.12Aleksey Midenkov2017-11-071-1/+222
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
| * | | | | SQL: partitioning misc fixes [closes #242]Aleksey Midenkov2017-09-071-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cleanup: *never* use assert(A && B) * vers_setup_1() revisited * vers_setup_2() renamed * partition_element::type removed * Copy ctor instead of memcpy() * Handle return value from check_range_constants() * Malloc error fix * error, style, misc fixes
| * | | | | Style: partitioning, sysvars, handler fixesAleksey Midenkov2017-09-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Sys_var_vers_asof formatting * Vers_field_stats renamed to Vers_min_max_stats * Item_temporal_literal::set_lower()/set_higher() replaced by operator>()/operator<() * handler API comments
| * | | | | Style: API renamesAleksey Midenkov2017-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | part_recs_slow() -> part_records(); HTON_SUPPORTS_SYS_VERSIONING -> HTON_NATIVE_SYS_VERSIONING.
| * | | | | IB, SQL: InnoDB partitioning [closes #118]Aleksey Midenkov2017-05-051-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | * native InnoDB partitioning for BY SYSTEM_TIME partitions.
| * | | | | SQL: (0.6) Pruning for VERSIONING partitions [closes #97]Aleksey Midenkov2017-05-051-10/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * based on RANGE pruning by COLUMNS (sys_trx_end) condition * removed DEFAULT; AS OF NOW is always last; current VERSIONING as last non-empty (or first empty) * Min/Max stats in TABLE_SHARE * ALTER TABLE ADD PARTITION adds before AS OF NOW partition
| * | | | | SQL: (0.5) Versioned partitions [closes #77]Aleksey Midenkov2017-05-051-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * one `AS OF NOW`, multiple `VERSIONING` partitions; * rotation of `VERSIONING` partitions by record count, time period; * rotation is multi-threaded; * conventional subpartitions as bottom level for versioned partitions; * `DEFAULT` keyword selects first `VERSIONING` partition; * ALTER TABLE ADD/DROP partition; * REBUILD PARTITION basic operation.
* | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-121-3/+2
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-07-081-3/+2
| |\ \ \ \ \ | | | |/ / / | | |/| | |