MySQL Forums
Forum List  »  Partitioning

I divided table on two parts, but MySQL scanning full table
Posted by: oto shavadze
Date: February 07, 2012 11:27PM

Hello.
I write this query:

CREATE TABLE qwe(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
PRIMARY KEY(id)
)

PARTITION BY RANGE(id) (
PARTITION p_1 VALUES LESS THAN(50000),
PARTITION p_2 VALUES LESS THAN(MAXVALUE)
)

After, I insert into the table 100 000 record.
After, I make query with EXPLAIN ()

$res = mysqli_query($db, "EXPLAIN PARTITIONS SELECT name FROM qwe WHERE id > 70000");
while($row = mysqli_fetch_assoc($res)) {
echo $row["partitions"].' , '.$row["rows"].' <br>';
}


resultat:
p_2 , 100000

rezultat from "rows" is 100000.
Question: the table is divided the two parts, but MySQL scanning full table, why?
Please answer me if my question is clearly, this is very Important for me.

Options: ReplyQuote


Subject
Views
Written By
Posted
I divided table on two parts, but MySQL scanning full table
3155
February 07, 2012 11:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.