A heap table isn't a view, it's just a table in memory, when you stop mysql the table disappear. Are usefull for speed selects; you don't need access hd.
In the other hand views are definitions from other(s) table(s) stored in the db, are permanent and can be updated
Alejandro.
-------Mensaje original-------
Fecha: 04/13/04 11:30:05
Asunto: RE: What is the difference Between the mysql HEAP Table type and Views
Have you tried to update an underlying heap table? The heap table will not
be updated. A view is updated when any of the underlying table(s) are
updated.
-----Original Message-----
From: Abiola Aluko
Sent: 4/13/04 8:01 AM
Subject: What is the difference Between the mysql HEAP Table type and Views
I know this might sound like a rather funny question to many gurus out
here, but I'm a bit confused.
The example give in the mysql manual is:
mysql> CREATE TABLE test TYPE=HEAP SELECT ip,SUM(downloads) AS down
-> FROM log_table GROUP BY ip;
mysql> SELECT COUNT(ip),AVG(down) FROM test;
mysql> DROP TABLE test;
ironically the example given in the postgresql manual for views looks
like it does the same things as the above
sql statements:
CREATE VIEW myview AS
SELECT city, temp_lo, temp_hi, prcp, date, location
FROM weather, cities
WHERE city = name;
SELECT * FROM myview;
Please enlighten me.
Thanks
Abiola Aluko.
<<ATT145709.txt>>
--
MySQL General Mailing List
|