Go Back   CORTEX Forums > Best Practices > Tips and Techniques > Data Warehousing Tips and Techniques > DWH Tip Feeds
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

Common Schema: dependencies routines

This is a discussion on Common Schema: dependencies routines within the DWH Tip Feeds forums, part of the Data Warehousing Tips and Techniques category; Are you a MySQL DBA? Checkout the common_schema project by Oracle Ace Shlomi Noach . The common_schema is an open source MySQL schema that packs a number of utility views, ...


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 2nd December 2011, 05:49 AM   #1
News Bot
 
Join Date: Nov 2007
Posts: 15,067
Latest News Headlines is on a distinguished road
Post Common Schema: dependencies routines

Are you a MySQL DBA? Checkout the common_schema project by Oracle Ace Shlomi Noach.

The common_schema is an open source MySQL schema that packs a number of utility views, functions and stored procedures. You can use these utilities to simplify MySQL database administration and development. Shlomi just released revision 178, and I'm happy and proud to be working together with Shlomi on this project.

Among the many cool features created by Shlomi, such as foreach, repeat_exec and exec_file, there are a few %_dependencies procedures I contributed:
  • get_event_dependencies(schema_name, event_name)
  • get_routine_dependencies(schema_name, routine_name)
  • get_sql_dependencies(sql, default_schema)
  • get_view_dependencies(schema_name, view_name)
All these procedures return a resultset that indicates which schema objects are used by the object identified by the input parameters. Here are a few examples that should give you an idea:
mysql> call common_schema.get_routine_dependencies('common_sch ema', 'get_routine_dependencies');
+---------------+----------------------+-------------+--------+
| schema_name | object_name | object_type | action |
+---------------+----------------------+-------------+--------+
| common_schema | get_sql_dependencies | procedure | call |
| mysql | proc | table | select |
+---------------+----------------------+-------------+--------+
2 rows in set (0.19 sec)

Query OK, 0 rows affected (0.19 sec)

mysql> call common_schema.get_routine_dependencies('common_sch ema', 'get_sql_dependencies');
+---------------+-------------------+-------------+--------+
| schema_name | object_name | object_type | action |
+---------------+-------------------+-------------+--------+
| common_schema | _get_sql_token | procedure | call |
| common_schema | _sql_dependencies | table | create |
| common_schema | _sql_dependencies | table | drop |
| common_schema | _sql_dependencies | table | insert |
| common_schema | _sql_dependencies | table | select |
+---------------+-------------------+-------------+--------+
5 rows in set (1.59 sec)
Of course, there's always a lot to be desired. The main shortcomings as I see it now is that the dependencies are listed only one level deep: that is, the dependencies are not recursively analyzed. Another problem is that there is currently nothing to calculate reverse dependencies (which would arguably be more useful).

The good news is, this is all open source, and your contributions are welcome! If you're interested in the source code of these routines, checkout the common_schema project, and look in the common_schema/routines/dependencies directory.

If you'd like to add recursive dependencies, or reverse dependencies, or if you find a bug or have a request for improvement or a new feature, then don't hesitate and contribute. If you have a one-off contribution that relates directly to these dependencies routines, then it's probably easiest if you email me directly, and I'll see what I can do to get it in. If you are interested in more long term contribution, it's probably best if you write Shlomi, as he is the owner of the common_schema project.

For now, enjoy, and untill next time.


More from Roland Bouman's Blog ...
Latest News Headlines is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTweet this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google, Bing and Yahoo join hands for new schema.org to make search easy admin Analytic News Feeds 0 10th June 2011 05:14 AM
Semantic Adaptation of Schema Mappings when Schemas Evolve admin Analytic News Feeds 0 8th September 2010 12:00 AM
Strata of common and not so common colors admin Analytic News Feeds 0 10th June 2010 06:00 AM
MySQL Conference 2010 Presentation: Optimizing Stored Routines Latest News Headlines DWH Tip Feeds 0 15th April 2010 03:33 AM
Common Terms admin A - C 0 26th January 2010 10:45 AM


All times are GMT +11. The time now is 06:53 PM.

© The Business Intelligence Group

Search Engine Optimization by vBSEO