Sign in or Join FriendFeed
FriendFeed is the easiest way to share online. Learn more »
Boris Gordon
LinuxPlanet - Tutorials - Using Temporary Tables to Speed Up MySQL - When to use Temporary Tables - http://www.linuxplanet.com/linuxpl...
Knowing how to use temporary tables in your stored procedures is a great way to save time and effort, particularly when dealing with multiple queries that return very large and/or similar resultsets. If you're fetching several resultsets that contain a lot of common data, it can make sense to obtain a single resultset that has all the data that's required, store it in a temporary table, and then select from this temporary table as needed. Similarly, when repeatedly referring to the same subset of table data, it's often faster and more economical to store results in a temporary table, rather than repeating a complex join several times. In today's article, we'll review just how easily temporary tables can be utilized to make your stored procedures more efficient. - Boris Gordon