cosmicperl has asked for the wisdom of the Perl Monks concerning the following question:
They now look like:-SELECT sum(numlog) FROM table1 WHERE date IN ( '12:04:2007', '12:05:20 +07', ... up to 500 odd dates)
I fired it up, looking forward to what I expected to be a huge speed increase (the table I'm testing has over half a million records). Right now I want to cry as the new code it actually running slower. So I tested just the MySQL and it gave me the same results, trying out the new sql and a new take on the old:-SELECT sum(numlog) FROM table1 WHERE date >= 20071204 AND date < 20080 +112
The new one take about 4.2 seconds on average, the old one takes about 3.9 on average.SELECT sum(numlog) FROM table1 WHERE date IN ( '20071204', '20071205', + ... 30 days)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl and MySQL woes
by kyle (Abbot) on Jan 13, 2008 at 03:14 UTC | |
by cosmicperl (Chaplain) on Jan 13, 2008 at 03:53 UTC | |
by ysth (Canon) on Jan 13, 2008 at 07:15 UTC | |
|
Re: Perl and MySQL woes
by McDarren (Abbot) on Jan 13, 2008 at 03:38 UTC | |
by KurtSchwind (Chaplain) on Jan 13, 2008 at 14:15 UTC | |
by cosmicperl (Chaplain) on Jan 13, 2008 at 03:48 UTC | |
|
Re: Perl and MySQL woes
by graff (Chancellor) on Jan 13, 2008 at 07:33 UTC | |
by kyle (Abbot) on Jan 13, 2008 at 13:32 UTC | |
|
Re: Perl and MySQL woes
by Gangabass (Vicar) on Jan 13, 2008 at 08:55 UTC | |
|
Re: Perl and MySQL woes
by aquarium (Curate) on Jan 13, 2008 at 21:49 UTC | |
by jasonk (Parson) on Jan 14, 2008 at 01:55 UTC |