# How to store temporary results best?

**URL:** <https://forums.percona.com/t/how-to-store-temporary-results-best/998>\
**Category:** Other MySQL® Questions\
**Created:** [November 11, 2008, 11:13am UTC](https://forums.percona.com/t/how-to-store-temporary-results-best/998 "2008-11-11T11:13:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nyze1984](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@Nyze1984](https://forums.percona.com/u/Nyze1984)\
**Post date:** [November 11, 2008, 11:13am UTC](https://forums.percona.com/t/how-to-store-temporary-results-best/998/1 "2008-11-11T11:13:40Z")

</div>

Dear Community

I need your advice ) In our company we have a database with lots of tables and each table contains more then 500.000 rows.

My Job is to create a backend interface where user can select data via a filter interface and then keeping the results in a new table for later use. So far so good but i run into the problem that handling this large data takes a lot of time.

For Example

CREATE TABLE `searcg_xxtemp` ( `id` bigint(20) unsigned NOT NULL auto\_increment, `name` varchar(30) default NULL, `pw` varchar(30) default NULL, `email` varchar(255) default NULL, `isanonym` tinyint(4) NOT NULL default ‘0’, `lastlogindatum` datetime NOT NULL default ‘0000-00-00 00:00:00’, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `user_idkennung` (`id`,`kennung`), FULLTEXT KEY `pw` (`pw`)) ENGINE=MyISAM SELECT \* FROM user WHERE {Filterdata goes here}

This takes a lot of time because in worst case the SELECT statement returns 500.000 rows. How can handle this the best and fastest way. I need a good solution how to store the temporary results for later use! Maybe you can give me a good hint )

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [December 25, 2009, 10:25am UTC](https://forums.percona.com/t/how-to-store-temporary-results-best/998/2 "2009-12-25T10:25:42Z")

</div>

Probably with CREATE TEMPORARY TABLE.
