Dathan Pattishall wrote:

Hmm that's a range, that should do a table scan in 4.0.18,

Yes... I believe it did but since its a memory table it went by really quick.

since a
memory table type is just a hash table. In 4.1 I believe it supports
ranges since the table is more of a myISAM type.


Yes... but only if an index is used... we don't have a btree index here...

Is there an index on TIMESTAMP?



No... Not a btree index. There are hash indexes but on other cols so they won't be used.

Does the range cover more then 30% of the table?


Yes... it does a full table scan.

I rewrote it as an EXPLAIN:

mysql> EXPLAIN

   -> SELECT * FROM FOO_MEMORY WHERE FOO_MEMORY.TIMESTAMP < 1105055409729;

+----+-------------+-------------+------+---------------+------+---------+------+---------+-------------+

| id | select_type | table       | type | possible_keys | key  | key_len | ref  
| rows    | Extra       |

+----+-------------+-------------+------+---------------+------+---------+------+---------+-------------+

|  1 | SIMPLE      | FOO_MEMORY  | ALL  | NULL          | NULL |    NULL | NULL 
| 3505527 | Using where |

+----+-------------+-------------+------+---------------+------+---------+------+---------+-------------+

1 row in set (0.00 sec)

3505527 is the full size of our table so...... its doing a full table scan. Very strange...

Kevin

--

Use Rojo (RSS/Atom aggregator). Visit http://rojo.com. Ask me for an invite! Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

If you're interested in RSS, Weblogs, Social Networking, etc... then you should work for Rojo! If you recommend someone and we hire them you'll get a free iPod!
Kevin A. Burton, Location - San Francisco, CA
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to