List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:January 8 2000 10:31pm
Subject:question about mysql-3.23.8 heap table
View as plain text  
Hi!

>>>>> "kenny" == kenny Xu <kenny@stripped> writes:

kenny> I created a table like:
kenny> CREATE TABLE test (
kenny>     a int not null default 0,
kenny>     b int not null default 0,
kenny>     key(a),
kenny>     key(b)
kenny>     ) TYPE=HEAP;

<cut>

--------> Everything seems good while just 7 rows. Then...

mysql> insert into test values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
kenny> Query OK, 7 rows affected (0.00 sec)
kenny> Records: 7  Duplicates: 0  Warnings: 0

mysql> select * from test where a=1;
kenny> +---+---+
kenny> | a | b |
kenny> +---+---+
kenny> | 1 | 6 |
kenny> +---+---+
kenny> 1 row in set (0.00 sec)

mysql> select * from test where a=2;
kenny> +---+---+
kenny> | a | b |
kenny> +---+---+
kenny> | 2 | 3 |
kenny> +---+---+
kenny> 1 row in set (0.00 sec)

The HEAP tables doesn't yet have the feature to scan for the next key
using indexes; I have forgot to mention this in the HEAP definition of
MySQL. The first case works because in this case MySQL does a full
scan of the table..

I shall try to add index-read-next for heap tables for the next
release. Sorry for the inconvenience.

Yours,
Monty
Thread
question about mysql-3.23.8 heap tablekenny Xu8 Jan
  • question about mysql-3.23.8 heap tableMichael Widenius9 Jan