[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql
Subject: mysql: Very long querys
From: Alexandre Baumeister <alex () finance-net ! com>
Date: 1998-07-31 17:17:48
[Download RAW message or body]
Bonjour,
Here are description of two tables:
mysql> describe infos_symbole;
+---------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-----------------------+------+-----+---------+-------+
| symbole | varchar(20) | | PRI | | |
| libelle | varchar(50) | YES | | NULL | |
| sicovam | mediumint(8) unsigned | YES | | NULL | |
| indice | varchar(40) | YES | | NULL | |
| marche | smallint(5) unsigned | YES | | NULL | |
+---------+-----------------------+------+-----+---------+-------+
5 rows in set (0.01 sec)
mysql> describe ticks_paris;
+---------+---------------------------+------+-----+------------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+---------------------------+------+-----+------------+-------+
| id | int(10) unsigned zerofill | | PRI | 0000000000 | |
| symbole | char(10) | | PRI | | |
| heure | time | | | 00:00:00 | |
| type | tinyint(4) | | | 0 | |
| prix | double(12,2) | | | 0.00 | |
| volume | int(10) unsigned | | | 0 | |
+---------+---------------------------+------+-----+------------+-------+
6 rows in set (0.00 sec)
And two queries:
mysql> select MAX(t.prix) from ticks_paris t,infos_symbole i where t.symbole=i.sym
bole and i.sicovam=12040;
+-----------+
| MAX(prix) |
+-----------+
| 1596.00 |
+-----------+
1 row in set (1.35 sec)
mysql> select i.libelle,MAX(t.prix) from ticks_paris t,infos_symbole i where t.sym
bole=i.symbole and i.sicovam=12040;
+---------+-----------+
| libelle | MAX(prix) |
+---------+-----------+
| ACCOR | 1596.00 |
+---------+-----------+
1 row in set (2 min 54.46 sec)
What's happening ? Why the second one is so long ?
-----------------------------------------------------------------------
Alexandre BAUMEISTER
Email : alex@finance-net.com
-----------------------------------------------------------
Send a mail to mdomo@tcx.se with
unsubscribe mysql your@subscription.address
in the body of the message to unsubscribe from this list.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic