<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/sql/table_cache.h, branch bb-svoj</title>
<subtitle>github.com: MariaDB/server.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/'/>
<entry>
<title>- Renaming variables so that they don't shadow others (After this patch one can compile with -Wshadow and get much fewer warnings)</title>
<updated>2015-07-06T17:24:14+00:00</updated>
<author>
<name>Monty</name>
<email>monty@mariadb.org</email>
</author>
<published>2015-07-06T17:24:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=7332af49e4ce125a5e316e7e0c82d44df4af54c4'/>
<id>7332af49e4ce125a5e316e7e0c82d44df4af54c4</id>
<content type='text'>
- 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 -&gt; join_examined_rows
   record_count -&gt; 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- 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 -&gt; join_examined_rows
   record_count -&gt; 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-8339 - Server crash during table cache eviction</title>
<updated>2015-06-29T07:07:23+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2015-06-25T10:21:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=a0f5f407eb7dfd7a2d7669e4f61245c72b1e0583'/>
<id>a0f5f407eb7dfd7a2d7669e4f61245c72b1e0583</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-8324 - MariaDB fails to build with performance schema disabled</title>
<updated>2015-06-19T11:06:33+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2015-06-17T08:37:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=2b253ed41fb606de3c6d8573f95f69ae2faf18d3'/>
<id>2b253ed41fb606de3c6d8573f95f69ae2faf18d3</id>
<content type='text'>
Various fixes to let MariaDB compile with performance schema disabled.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Various fixes to let MariaDB compile with performance schema disabled.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replaced lf-hash element_size hack with initializer function.</title>
<updated>2015-03-04T09:34:53+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2015-03-04T07:01:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=f4f37533a09b9776e8d5ac3f3a27957f553c9043'/>
<id>f4f37533a09b9776e8d5ac3f3a27957f553c9043</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-7324 - Lock-free hash for table definition cache</title>
<updated>2014-12-28T15:46:18+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2014-12-28T15:42:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=6dbc48ca79e5fdd8d4022b00b862e08a4198155b'/>
<id>6dbc48ca79e5fdd8d4022b00b862e08a4198155b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-5864 - Reduce usage of LOCK_open: TABLE_SHARE::tdc.free_tables</title>
<updated>2014-03-20T07:11:13+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2014-03-20T07:11:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=e4fde57712afd106ccf9752ceadcdcac604da8d9'/>
<id>e4fde57712afd106ccf9752ceadcdcac604da8d9</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-5675 - Performance: my_hash_sort_bin is called too often</title>
<updated>2014-03-06T12:19:12+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2014-03-06T12:19:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=b95c8ce530cbbd92b232324dc2c4376615bd1b5d'/>
<id>b95c8ce530cbbd92b232324dc2c4376615bd1b5d</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-5492 - Reduce usage of LOCK_open: TABLE::in_use</title>
<updated>2014-02-13T06:44:10+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2014-02-13T06:44:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=048e9c40a661476d1b742f61d692f211acbd24d2'/>
<id>048e9c40a661476d1b742f61d692f211acbd24d2</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-5388 - Reduce usage of LOCK_open: unused_tables</title>
<updated>2013-12-12T17:49:14+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2013-12-12T17:49:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=2d7c073852767a518424a48667a6e45452178681'/>
<id>2d7c073852767a518424a48667a6e45452178681</id>
<content type='text'>
Removed unused_tables, find LRU object by timestamp instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Removed unused_tables, find LRU object by timestamp instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-4702 - Reduce usage of LOCK_open</title>
<updated>2013-08-14T08:48:50+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2013-08-14T08:48:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=b7f9c894236c38cb40b5ca70e36d23497fcc01be'/>
<id>b7f9c894236c38cb40b5ca70e36d23497fcc01be</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
