sql - MySQL select query returns 250K+ results, delete query only deletes one? -


i don't understand this. i've dropped table , recreated multiple times, , it's same every time. when run query:

select * `squares` mbrcontains(polyfromtext('polygon((-34 166, -34 171, -41 171, -41 166, -34 166))'), `coordinate`); 

i'm returned on 250,000 results, correct. when try , alter query delete based on clause, so:

delete `squares` mbrcontains(polyfromtext('polygon((-34 166, -34 171, -41 171, -41 166, -34 166))'), `coordinate`); 

mysql sees fit delete single row @ time. i'm not going click 'go' 250k+ times. why this? here's table structure...

`squares` (    `square_id` int(7) unsigned not null,    `ref_coord_lat` double(8,6) not null,    `ref_coord_long` double(9,6) not null,    `coordinate` point not null,    primary key (`square_id`),    key `ref_coord_lat` (`ref_coord_lat`),    key `ref_coord_long` (`ref_coord_long`),    spatial `coordinate` (`coordinate`) ) engine=myisam default charset=latin1; 

if it's use, mysql 5.5.27, running on phpmyadmin 3.5.2.2. ideas?

try optimising table squares.

edit: or add limit:

delete `squares` mbrcontains(polyfromtext('polygon((-42 175, -42 179, -48 179,     -48 175, -42 175))'), `coordinate`) limit 10000; 

play limit parameter if can.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo