1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-15 05:41:27 +03:00

SQL: (0.6) Pruning for VERSIONING partitions [closes #97]

* 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
This commit is contained in:
Aleksey Midenkov
2016-12-31 15:33:26 +00:00
parent e069de7d9d
commit 26a3ff0a22
17 changed files with 627 additions and 354 deletions

View File

@@ -561,6 +561,8 @@ struct TABLE_STATISTICS_CB
bool histograms_are_read;
};
class Vers_field_stats;
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
@@ -752,26 +754,30 @@ struct TABLE_SHARE
uint16 row_start_field;
uint16 row_end_field;
uint32 hist_part_id;
List<void> free_parts;
bool free_parts_init;
Vers_field_stats** stat_trx;
ulonglong stat_serial; // guards check_range_constants() updates
bool busy_rotation;
mysql_mutex_t LOCK_rotation;
mysql_cond_t COND_rotation;
mysql_rwlock_t LOCK_stat_serial;
void vers_init()
{
hist_part_id= UINT32_MAX;
busy_rotation= false;
free_parts.empty();
free_parts_init= true;
stat_trx= NULL;
stat_serial= 0;
mysql_mutex_init(key_TABLE_SHARE_LOCK_rotation, &LOCK_rotation, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_TABLE_SHARE_COND_rotation, &COND_rotation, NULL);
mysql_rwlock_init(key_rwlock_LOCK_stat_serial, &LOCK_stat_serial);
}
void vers_destroy()
{
mysql_mutex_destroy(&LOCK_rotation);
mysql_cond_destroy(&COND_rotation);
mysql_rwlock_destroy(&LOCK_stat_serial);
}
Field *vers_start_field()
@@ -784,12 +790,6 @@ struct TABLE_SHARE
return field[row_end_field];
}
void vers_part_rotate()
{
DBUG_ASSERT(!free_parts.is_empty());
hist_part_id= (ulong)(void *)(free_parts.pop());
}
void vers_wait_rotation()
{
while (busy_rotation)