summaryrefslogtreecommitdiff
path: root/sql/table_cache.h
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | |
* | | MDEV-11153 - Introduce status variables for table cache monitoring and tuningSergey Vojtovich2017-10-311-0/+1
|/ / | | | | | | | | Status variables added: Table_open_cache_hits, Table_open_cache_misses, Table_open_cache_overflows, Table_open_cache_active_instances.
* | In table cache code, fix casts from longlong to long forVladislav Vaintroub2017-09-291-4/+8
| | | | | | | | | | | | | | | | | | 'version' variables. The warnings occur on Windows build, yet they are also are valid on 32bit Unix. Fix is to consistently use 64bit integer on all platforms.
* | MDEV-10296 - Multi-instance table cacheSergey Vojtovich2016-09-161-1/+1
| | | | | | | | | | | | | | | | Fixed sysvars_server_[not]embedded failure: changed type of table_open_cache_instances from ulong to uint. Added casts foratomic operations around tc_active_instances and tc_contention_warning_reported: needed on some platforms.
* | MDEV-10296 - Multi-instance table cacheSergey Vojtovich2016-09-161-6/+16
| | | | | | | | Improve scalability by implementing multi-instance table cache.
* | MDEV-5535: Cannot reopen temporary tableNirbhay Choubey2016-06-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqld maintains a list of TABLE objects for all temporary tables created within a session in THD. Here each table is represented by a TABLE object. A query referencing a particular temporary table for more than once, however, failed with ER_CANT_REOPEN_TABLE error because a TABLE_SHARE was allocate together with the TABLE, so temporary tables always had only one TABLE per TABLE_SHARE. This patch lift this restriction by separating TABLE and TABLE_SHARE objects and storing TABLE_SHAREs for temporary tables in a list in THD, and TABLEs in a list within their respective TABLE_SHAREs.
* | Some trivial changes.Nirbhay Choubey2016-06-101-0/+3
| |
* | Move table cache private functions out of headerSergey Vojtovich2016-06-011-139/+1
| | | | | | | | | | | | This is mostly needed to hide all references to free_tables, so that further implementation of multi-instance list can be done completely inside table_cache.cc
* | Cleanup All_share_tables_list definitionSergey Vojtovich2016-03-221-1/+3
| |
* | MDEV-9488 - Table cache cleanupsSergey Vojtovich2016-02-261-52/+2
| | | | | | | | Remove tdc_acquire_share() helpers: they don't actually make things simpler.
* | MDEV-9488 - Table cache cleanupsSergey Vojtovich2016-02-261-1/+0
|/ | | | | tdc_assign_new_table_id() does not relate to table cache, move it out of table_cache.cc.
* - Renaming variables so that they don't shadow others (After this patch one ↵Monty2015-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | can compile with -Wshadow and get much fewer warnings) - Changed ER(ER_...) to ER_THD(thd, ER_...) when thd was known or if there was many calls to current_thd in the same function. - Changed ER(ER_..) to ER_THD_OR_DEFAULT(current_thd, ER...) in some places where current_thd is not necessary defined. - Removing calls to current_thd when we have access to thd Part of this is optimization (not calling current_thd when not needed), but part is bug fixing for error condition when current_thd is not defined (For example on startup and end of mysqld) Notable renames done as otherwise a lot of functions would have to be changed: - In JOIN structure renamed: examined_rows -> join_examined_rows record_count -> join_record_count - In Field, renamed new_field() to make_new_field() Other things: - Added DBUG_ASSERT(thd == tmp_thd) in Item_singlerow_subselect() just to be safe. - Removed old 'tab' prefix in JOIN_TAB::save_explain_data() and use members directly - Added 'thd' as argument to a few functions to avoid calling current_thd.
* MDEV-8339 - Server crash during table cache evictionSergey Vojtovich2015-06-291-1/+1
| | | | | | | TDC_element::free_tables_back() had pre-lfhash leftover code, which referenced TDC_element::free_tables via TDC_element::share. This is not correct as share may be NULL (newly inserted or to be removed), instead access free_tables directly.
* MDEV-8324 - MariaDB fails to build with performance schema disabledSergey Vojtovich2015-06-191-0/+2
| | | | Various fixes to let MariaDB compile with performance schema disabled.
* Replaced lf-hash element_size hack with initializer function.Sergey Vojtovich2015-03-041-0/+9
|
* MDEV-7324 - Lock-free hash for table definition cacheSergey Vojtovich2014-12-281-15/+165
|
* MDEV-5864 - Reduce usage of LOCK_open: TABLE_SHARE::tdc.free_tablesSergey Vojtovich2014-03-201-1/+0
| | | | | | Let TABLE_SHARE::tdc.free_tables, TABLE_SHARE::tdc.all_tables, TABLE_SHARE::tdc.flushed and corresponding invariants be protected by per-share TABLE_SHARE::tdc.LOCK_table_share instead of global LOCK_open.
* MDEV-5675 - Performance: my_hash_sort_bin is called too oftenSergey Vojtovich2014-03-061-2/+6
| | | | | | | | | | | | | | | Reduced number of my_hash_sort_bin() calls from 4 to 1 per query. Reduced number of memory accesses done by my_hash_sort_bin(). Details: - let MDL subsystem use pre-calculated hash value for hash inserts and deletes - let table cache use pre-calculated MDL hash value - MDL namespace is excluded from hash value calculation, so that hash value can be used by table cache as is - hash value for MDL is calculated as resulting hash value + MDL namespace - extended hash implementation to accept user defined hash function
* MDEV-5492 - Reduce usage of LOCK_open: TABLE::in_useSergey Vojtovich2014-02-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Move TABLE::in_use out of LOCK_open. This is done with assumtion that foreign threads accessing TABLE::in_use will only need consistent value _after_ marking table for flush and purging unused table instances. In this case TABLE::in_use will always point to a valid thread object. Previously FLUSH TABLES thread may wait for tables flushed subsequently by concurrent threads which breaks the above assumption, e.g.: open tables: t1 (version= 1) thr1 (FLUSH TABLES): refresh_version++ thr1 (FLUSH TABLES): purge table cache open tables: none thr2 (SELECT * FROM t1): open tables: t1 open tables: t1 (version= 2) thr2 (FLUSH TABLES): refresh_version++ thr2 (FLUSH TABLES): purge table cache thr1 (FLUSH TABLES): wait for old tables (including t1 with version 2) It is fixed so that FLUSH TABLES waits only for tables that were open heretofore.
* MDEV-5388 - Reduce usage of LOCK_open: unused_tablesSergey Vojtovich2013-12-121-1/+0
| | | | Removed unused_tables, find LRU object by timestamp instead.
* MDEV-4702 - Reduce usage of LOCK_openSergey Vojtovich2013-08-141-0/+134
Following variables do not require LOCK_open protection anymore: - table_def_cache (renamed to tdc_hash) is protected by rw-lock LOCK_tdc_hash; - table_def_shutdown_in_progress doesn't need LOCK_open protection; - last_table_id use atomics; - TABLE_SHARE::ref_count (renamed to TABLE_SHARE::tdc.ref_count) is protected by TABLE_SHARE::tdc.LOCK_table_share; - TABLE_SHARE::next, ::prev (renamed to tdc.next and tdc.prev), oldest_unused_share, end_of_unused_share are protected by LOCK_unused_shares; - TABLE_SHARE::m_flush_tickets (renamed to tdc.m_flush_tickets) is protected by TABLE_SHARE::tdc.LOCK_table_share; - refresh_version (renamed to tdc_version) use atomics.