WL#4298: Metadata cache for all objects

Affects: Server-6.1 — Status: Assigned — Priority: Low

Extend the table definition cache to allow to store definitions of
 * views
 * stored procedures and functions
 * generally, any type of metadata

* the locking mechanism should allow coordination between multiple caches, while 
minimizing serialization of threads.


The current TDC API is:

struct TABLE_SHARE
{
TABLE *used_tables;
TABLE *unused_tables;
void *frm_data;
};

/**
Return a table share instance if it's in the cache
The share shall be released to the TDC after it's
not used with tdc_release_share().
*/

TABLE_SHARE *
tdc_find_share(const char *name);


/**
Find or insert a new share. Looks up the share on disk and
reads the .frm.
*/

TABLE_SHARE *
tdc_find_or_insert_share(const char *name);

/**
Should follow each call to tdc_find_share() or
tdc_find_or_insert_share()
*/

void
tdc_release_share(TABLE_SHARE *share);

/**
Remove the share from the TDC.

@precondition The share has no tables associated with it.
*/

void
tdc_remove_share(const char *name);

/**
Move a table from unused_tables to used_tables list
*/

void
tdc_use_table(TABLE_SHARE *share, TABLE *table);

/**
Move the table in the opposite direction.
*/

void
tdc_unuse_table(TABLE_SHARE *share, TABLE *table);

/**
Add a new table to used_tables list.
*/
void
tdc_add_table(TABLE_SHARE *share, TABLE *table);

/**
Remove the table from unused_tables list.
*/

void
tdc_remove_table(TABLE_SHARE *share, TABLE *table);

You must be logged in to tag this worklog

No Comments yet

Votes

  • Rated 4.00 out of 5
Rated 4.00 out of 5 with 1 votes cast.
You must be logged in to vote.

Watches

0 members are watching this worklog
You must be logged in to track this worklog.

Provide Feedback

Please note:
HTML will be purified, but we allow for a number of HTML tags so that you have the flexibility to decorate your comment text to some extent. The comments allow the following HTML tags:

strong, b, em, blockquote, a, code, pre

To put code into your comment, simply encapsulate your code with
[code language="XXX"][/code], where XXX is any common language, for instance "PHP", "SQL", "C", etc.



You must be logged in to comment