"Nils Valentin" <[EMAIL PROTECTED]> wrote:
> I have some questions about temporary tables. I would appreciate any replies:
>
> I created a temporary table f.e. like this:
>
> mysql> create temporary table temp SELECT * FROM relations;
> Query OK, 4 rows affected (2.35 sec)
> Records: 4 Duplicates: 0 Warnings: 0
>
> When I do
>
> mysql> show create table temp;
>
> Then it will give me this:
>
> | temp | CREATE TEMPORARY TABLE `temp` (
> `member_id` int(16) NOT NULL default '0',
> `company_id` int(16) NOT NULL default '0',
> `membership_id` int(16) NOT NULL default '0'
> ) TYPE=MyISAM CHARSET=latin1 |
>
>
> Now what confuses me is that
>
> a) it says here TYPE=MyISAM
Because MyISAM is default table type
> b) I understood that only HEAP tables are stored in the memory.
Yes.
> I was assuming (until now) that HEAP tables are (the only one type of)
> temporary tables.
Temporary tables may have type HEAP.
> I tried
>
> CREATE TEMPORARY TABLE temp TYPE= InnoDB SELECT * FROM relations;
> or
> CREATE TEMPORARY TABLE temp TYPE= HEAP SELECT * FROM relations;
>
> and they are all created as in-memory tables no files are created.
> Can I use any table format (ISAM,MYISAM,BDB,InnoDB,HEAP) for temporary tables
You can use MyISAM, ISAM, MERGE, HEAP, InnoDB.
Temporary table files are created in the temporary directory:
http://www.mysql.com/doc/en/Temporary_files.html
> If, so what would be the difference between a temporary table in general and a
> HEAP table ?
Temporary tables are the per-connection tables.
HEAP tables are stored in memory tables.
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]