[MDEV-4956] Reduce usage of LOCK_open: TABLE_SHARE::tdc.used_tables Created: 2013-08-27  Updated: 2014-03-27  Resolved: 2013-12-12

Status: Closed
Project: MariaDB Server
Component/s: None
Fix Version/s: 10.0.7

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File mdev4956.patch    
Issue Links:
Relates
relates to MDEV-5388 Reduce usage of LOCK_open: unused_tables Closed
relates to MDEV-5492 Reduce usage of LOCK_open: TABLE::in_use Closed
relates to MDEV-5864 Reduce usage of LOCK_open: TABLE_SHAR... Closed
relates to MDEV-4702 Reduce usage of LOCK_open Closed
relates to MDEV-5403 Reduce usage of LOCK_open: tc_count Closed
relates to MDEV-5597 Reduce usage of LOCK_open: LOCK_flush Closed

 Description   

tc_acquire_table and tc_release_table are critical sections of table cache. Among other things, they update TABLE_SHARE::tdc.used_tables:
tc_acquire_table - push new TABLE object to used_tables
tc_release_table - remove TABLE object from used_tables

used_tables list is not really necessary for table cache to operate properly. We can change it with all_tables list instead. tc_acquire_table and tc_release_table wont need to access all_tables list at all.

The cost is as following:

  • 2 additional pointers per TABLE object
  • SHOW OPEN TABLES will have to iterate all_tables and skip objects with in_use == 0
  • same for TABLE_SHARE::visit_subgraph()
  • same for kill_delayed_threads_for_table()

A patch for this task has been tested (read-only single table OLTP, 4 CPU linux server) and shown ~30% lower LOCK_open wait time and ~20% higher tps.



 Comments   
Comment by Sergey Vojtovich [ 2013-08-27 ]

Sergei, please review attached patch. Committed patch didn't reach mailing list for some reason.

Comment by Sergey Vojtovich [ 2013-12-11 ]

Sergei, please review updated patch:
Date: Tue, 10 Dec 2013 15:00:43 +0000 (UTC)
From: Sergey Vojtovich <svoj@mariadb.org>
To: commits@mariadb.org
Subject: [Commits] Rev 3914: MDEV-4956 - Reduce usage of LOCK_open: TABLE_SHARE::tdc.used_tables in lp:maria/10.0

Comment by Sergey Vojtovich [ 2013-12-12 ]

Pushed to 10.0.7, revision-id: svoj@mariadb.org-20131210150036-imkvngj5125mukqu

Generated at Thu Feb 08 07:00:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.