Problem with result field list
Hello,
I have the next query:
SELECT gis_id, lat, long FROM gis WHERE lat > '40.4660506896973' AND lat < '40.4675506896973' AND long > '-3.65449994277954' AND long < '-3.65299994277954' LIMIT 10000;
and this other:
SELECT gis_id, lat, long, z1,z2,z3 FROM gis WHERE lat > '40.4660506896973' AND lat < '40.4675506896973' AND long > '-3.65449994277954' AND long < '-3.65299994277954' LIMIT 10000;
The table is:
+----------+---------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------------------+------+-----+---------+----------------+
| gis_id | bigint(20) unsigned | | PRI | NULL | auto_increment |
| lat | double | | MUL | 0 | |
| long | double | | | 0 | |
| z1 | varchar(22) | | | | |
| z2 | varchar(50) | | | | |
| z3 | varchar(100) | | | | |
+----------+---------------------+------+-----+---------+----------------+
Indexes:
+---------+------------+------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+---------+------------+------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| gis | 0 | PRIMARY | 1 | gis_id | A | 4562147 | NULL | NULL | | BTREE | |
| gis | 0 | latitud__longitud__IDX | 1 | lat | A | 4562147 | NULL | NULL | | BTREE | |
| gis | 0 | latitud__longitud__IDX | 2 | long | A | 4562147 | NULL | NULL | | BTREE | |
+---------+------------+------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
The first query is faster than second. The second takes a lot of time, 16 seconds aprox.
Subject
Views
Written By
Posted
Problem with result field list
3643
October 02, 2007 10:40AM
2282
October 24, 2007 02:54PM
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.