Home > MySQL > MySQL Temporary Table

MySQL Temporary Table

April 3rd, 2009

The following content is a test of MySQL memory temporary table,  I import 0.2m records into another table everyday,  that table is becoming larger and larger, and SELECT is more and more slow, to solve these problems, temporary table is used in middle processing.

The detail explanation can be found in MySQL official website.

=========================================

DROP TABLE IF EXISTS `tmp_trade`;
CREATE TABLE IF NOT EXISTS `tmp_trade` (
`ID` bigint(20) NOT NULL,
`date` date NOT NULL,
`time` time DEFAULT NULL,
`code` char(6) DEFAULT NULL,
`volume` bigint(20) DEFAULT NULL,
`price` float DEFAULT NULL,
`money` bigint(20) DEFAULT NULL,
`property` char(2) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=Memory DEFAULT CHARSET=gb2312;

drop table tmp_trade;

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Sphinn
  • Google Bookmarks
  • Furl
  • Spurl
  • Mixx
  • MySpace
  • Live
Author: admin Categories: MySQL Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

京ICP备09040235号