I can't see any way of making this statement faster, however:

One method to increase speed, especially since the amount of data is large
is to create seperate tables into your lowest common denominator, here year
(e.g. traffic_2000,traffic_2001 etc).

Then create a merge table with the same name as your current one i.e.
'traffic', such that you don't break any current functionality in your
application, then depending on your year value, to increase speed, consult
the specific year table e.g. traffic_2001.

re:
http://www.mysql.com/doc/M/E/MERGE.html


Regards,
Daniel

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 22 February 2002 4:20 p.m.
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: SQL query
>
>
> My concern here is the query speed....
>
> Mysql query on the statement result so slow...is there a way to
> improve it?
>
>
>
>
> R.B.Roa
> Traffic Management Engineer
> PhilCom Corporation
> Tel.No. (088) 858-1028
> Mobile No. (0919) 30856267
>
>
>       -----Original Message-----
>       From:   Daniel Rosher [SMTP:[EMAIL PROTECTED]]
>       Sent:   Friday, February 22, 2002 11:15 AM
>       To:     [EMAIL PROTECTED]; [EMAIL PROTECTED]
>       Subject:        RE: SQL query
>
>       I presuming you are expecting more results from the first select
> statement,
>       hence the reason and indicating this in the second, should then your
> first
>       statement be:
>
>       select edate from traffic where year(edate)='2001' group by
>       edate;
>
>       ?
>
>       Regards,
>       Dan
>
>       > -----Original Message-----
>       > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>       > Sent: Friday, 22 February 2002 2:30 p.m.
>       > To: [EMAIL PROTECTED]
>       > Subject: SQL query
>       >
>       >
>       > Everyone,
>       >
>       > Have u encountered this kind of query?
>       >
>       > mysql> select edate from traffic where year(edate)='2001' group by
>       > month(edate);
>       >
>       > +------------+
>       > | edate      |
>       > +------------+
>       > | 2001-04-29 |
>       > | 2001-05-01 |
>       > | 2001-06-01 |
>       > | 2001-07-01 |
>       > | 2001-08-01 |
>       > | 2001-09-01 |
>       > | 2001-10-30 |
>       > | 2001-11-01 |
>       > | 2001-12-01 |
>       > +------------+
>       > 9 rows in set (10 min 53.83 sec)
>       >
>       > mysql> select count(*) from traffic;
>       > +----------+
>       > | count(*) |
>       > +----------+
>       > |  2645563 |
>       > +----------+
>       > 1 row in set (0.00 sec)
>       >
>       > mysql>
>       >
>       > is there a problem with my select statement?...
>       >
>       >
>       >
>       >
>       > R.B.Roa
>       > Traffic Management Engineer
>       > PhilCom Corporation
>       > Tel.No. (088) 858-1028
>       > Mobile No. (0919) 30856267
>       >
>       >
>       >
> ---------------------------------------------------------------------
>       > Before posting, please check:
>       >    http://www.mysql.com/manual.php   (the manual)
>       >    http://lists.mysql.com/           (the list archive)
>       >
>       > To request this thread, e-mail
> <[EMAIL PROTECTED]>
>       > To unsubscribe, e-mail
>       > <[EMAIL PROTECTED]>
>       > Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
>       >
>       >
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to