Using MySQL Meta Data Effectively

Slides:



Advertisements
Similar presentations
Chapter 4 Joining Multiple Tables
Advertisements

A comparison of MySQL And Oracle Jeremy Haubrich.
Results of the survey and relational dbs Fall 2011.
NewSQL By Michael Lebedev. NewSQL Easier to learn Elegant Consistent Well defined It is not a extension or subset of SQL, and not a Object database language!
NAVY Research Group Department of Computer Science Faculty of Electrical Engineering and Computer Science VŠB-TUO 17. listopadu Ostrava-Poruba.
NoSQL and NewSQL Justin DeBrabant CIS Advanced Systems - Fall 2013.
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2010 All Rights Reserved. 1.
SQL Basics+ Brandon Checketts. Why SQL? Structured Query Language Structured Query Language Frees programmers from dealing with specifics of data persistence.
CEDROM-SNi’s DITA- based Project From Analysis to Delivery By France Baril Documentation Architect.
PostgreSQL and relational databases As well as assignment 4…
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
March 19981© Dennis Adams Associates Tuning Oracle: Key Considerations Dennis Adams 25 March 1998.
PostgreSQL and relational databases As well as assignment 4…
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
CHAPTER 8 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Relational Database CISC/QCSE 810 some materials from Software Carpentry.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
SQL 101 for Web Developers 14 November What is a database and why have one? Tables, relationships, normalization SQL – What SQL is and isn’t – CRUD:
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Structure Query Language SQL. Database Terminology Employee ID 3 3 Last name Small First name Tony 5 5 Smith James
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2015, Fred McClurg, All Rights.
Chapter 5 Database Processing. Neil uses software to query a database, but it has about 25 standard queries that don’t give him all he needs. He imports.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Metadata Metadata is information about data or other information.
SQL Unit – 2 Base Knowledge Presented By Mr. R.Aravindhan.
SQL Basic. What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
WEB SECURITY WEEK 2 Computer Security Group University of Texas at Dallas.
CF Database I Jeff Peters Why Are You Here? Data and Persistence ODBC Relational vs. Flat SQL CFQUERY, CFOUTPUT, CFLOOP Practicum.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Table Structures and Indexing. The concept of indexing If you were asked to search for the name “Adam Wilbert” in a phonebook, you would go directly to.
Unit-8 Introduction Of MySql. Types of table in PHP MySQL supports various of table types or storage engines to allow you to optimize your database. The.
CS4432: Database Systems II
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
SQL Introduction SQL stands for “Structured Query Language” and can be pronounced as “SQL” or “sequel – (Structured English.
1 The World’s Most Popular Open Source Database Copyright 2006 Colin Charles and MySQL AB MySQL and Mac OS X Colin Charles Community Engineer
Introduction to Partitioning in SQL Server
ORDER BY Clause The result of a query can be sorted in ascending or descending order using the optional ORDER BY clause. The simplest form of.
Trigger used in PosgreSQL
Web Systems & Technologies
Database Access with SQL
COMP 430 Intro. to Database Systems
آشنایی با نرم افزار Microsoft Access
Advanced Accounting Information Systems
LINQ for SQL SQL Saturday May 2009 David Fekke.
Efficiently Searching Schema in SQL Server
Parameter Sniffing in SQL Server Stored Procedures
JDBC.
ISC440: Web Programming 2 Server-side Scripting PHP 3
SQL Tutorial.
Simple Partitioning Building a simple partitioning solution with SQL Server Stephen Fulcher.
11/18/2018 2:14 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
CSCI 2141 – Intro to Database Systems
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
SQL pepper.
Let's make a complex dataset simple using Azure Cosmos DB
Introduction To Structured Query Language (SQL)
Tutorial 6 PHP & MySQL Li Xu
Data Definition Language
PHP and MySQL.
Diving into Query Execution Plans
CPSC-608 Database Systems
An Introduction to Partitioning
Presentation transcript:

Using MySQL Meta Data Effectively Dossy Shiobara, Panoptic.com Session 10   Tuesday, June 29 4:45 PM - 5:45 PM

What is metadata? “Data about data” Information about the data in your database

Life before MySQL 5.0 Limited metadata available through ‘mysql’ meta-database and SHOW statement Adding new metadata types meant modifying the parser’s grammar

The INFORMATION_SCHEMA MySQL 5.0 introduces the INFORMATION_SCHEMA Typically abbreviated as “I_S” although MySQL still requires it spelled out fully in queries Specified by the non-free ANSI/ISO SQL:2003 standard MySQL-specific extensions – ENGINES, etc. A very good start! MySQL 5.1 exposes even more metadata through I_S PARTITIONS, PLUGINS, etc.

Why change now? Yet another new thing to learn SHOW statements work just fine INFORMATION_SCHEMA is a pain to type

Standards are good! Standards let us reuse our knowledge MySQL, PostgreSQL, SQL Server, DB2 have implemented INFORMATION_SCHEMA to varying degrees A SQL interface to metadata creates new opportunities to do cool stuff JOIN metadata tables in useful ways INSERT results of metadata queries into tables Plugin authors have a consistent way of exposing metadata Easier for products to support MySQL

Read The Fine Manual MySQL documentation on INFORMATION_SCHEMA is excellent: Chapter 19. INFORMATION_SCHEMA Tables http://dev.mysql.com/doc/refman/5.5/en/information-schema.html

Search on columns mysql> SELECT table_name, column_name, column_type FROM information_schema.columns WHERE table_schema = DATABASE() AND column_type LIKE ‘%text%’; vs. mysql> SHOW COLUMNS FROM <tablename> WHERE type LIKE ‘%text%’; (for each table you want to check, one at a time)

Query results +-------------+-------------------------+-------------+ | table_name | column_name | column_type | | COLUMNS | COLUMN_DEFAULT | longtext | | COLUMNS | COLUMN_TYPE | longtext | | EVENTS | EVENT_DEFINITION | longtext | | PARTITIONS | PARTITION_EXPRESSION | longtext | | PARTITIONS | SUBPARTITION_EXPRESSION | longtext | | PARTITIONS | PARTITION_DESCRIPTION | longtext | | PLUGINS | PLUGIN_DESCRIPTION | longtext | | PROCESSLIST | INFO | longtext | | ROUTINES | ROUTINE_DEFINITION | longtext | | TRIGGERS | ACTION_CONDITION | longtext | | TRIGGERS | ACTION_STATEMENT | longtext | | VIEWS | VIEW_DEFINITION | longtext |

Optimizing tables mysql> SELECT table_name FROM information_schema.tables WHERE table_schema = DATABASE() AND data_free > 0;

Search stored procs mysql> SELECT routine_name FROM information_schema.routines WHERE routine_definition LIKE '%FROM tablename%';

Too good to be true Not all metadata is stored solely in memory Some queries may require disk I/O – sometimes a lot of it Sometimes, a global lock is held during I_S queries LOCK_open, the revolving door of MySQL Be careful using I_S in production!

It’s not over yet! MySQL will only get better with time Performance optimizations of the I_S implementation will come Still very useful knowledge to have Great in a non-production environment, today

Thanks for attending my session! Questions? Comments? The End Thanks for attending my session! Questions? Comments?