11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

www.it-ebooks.infoCHAPTER 25 • INTRODUCING MYSQL• Views: Database tables often consist of information that isn’t intended to beviewed by the public or, in many cases, by the programmers tasked with using thatdatabase. Views enable database administrators to limit access to database tablesto only the data that is intended to be used. Views also eliminate the need tocontinually construct potentially long and unwieldy queries that stretch acrossnumerous tables. A view is essentially a virtual representation of a subset of datafound in one or more tables. Views are discussed in Chapter 34.• Triggers: A trigger is essentially a stored procedure that is invoked based on theoccurrence of a defined event. Triggers are often used to validate or coerce databefore or after insertion into the table to comply with business logic or rules.Chapter 33 offers a thorough introduction to this new feature.• INFORMATION_SCHEMA: <strong>MySQL</strong> has long supported the SHOW command, anonstandard means for learning more about data structures residing in thedatabase server. However, this methodology is incompatible with all otherdatabases, and is also restrictive because the SHOW command can’t be used inSELECT statements. To resolve this limitation, a new virtual database,INFORMATION_SCHEMA, was added as of version 5.0. This database stores metadatainformation about all the other databases found on the server. By way of thisdatabase, users can now use the standard SELECT statement to learn more about adatabase’s structure.<strong>MySQL</strong> 5.1Don’t let the point release number fool you; <strong>MySQL</strong> 5.1 is a significant release in the product’s history.This section outlines just a few of this release’s key features:• Pluggable Storage Engine API: Do you wish <strong>MySQL</strong> was able to authenticateagainst your custom user credential solution? Offer a custom data-filteringfunction? Query nonstandard data formats such as MP3 files? The PluggableStorage Engine API allows you to add your own custom capabilities, extending thedatabase in ways you never before dreamed possible.• Partitioning: Partitioning, or the splitting of tables into smaller physical pieces,can have several advantages when working with large amounts of data. Queryperformance can be greatly improved because table indexes are reduced to severalsmaller ranges rather than one large, contiguous range. Consider a scenario whereyou are analyzing customer invoices for a national retail chain. Rather than dealwith the potentially billions of records that could easily be generated in just a fewyears’ time, you might use partitioning to separate the invoices according to yearor month. Partitioning can also affect storage costs by making it possible to moveless commonly used table data to lower-cost storage media while still allowing itto be retrieved on demand.• Event scheduling: <strong>MySQL</strong>’s event-scheduling feature is similar to the Unix cronprogram, executing a SQL query according to a predefined schedule.• Load testing: A command-line program called mysqlslap was added to thedistribution, allowing you to test performance by executing SQL queries whileemulating a scenario where multiple clients are accessing the system.483

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!