raschu has asked for the wisdom of the Perl Monks concerning the following question:
testdb.pl:root@rschuler:~/chess/icc/chartbot# time perl testdb.pl frank001 (463) SidVicious (307) Lisebeth (272) Shawn (204) albi (149) real 0m6.341s user 0m5.956s sys 0m0.296s root@rschuler:~/chess/icc/chartbot# time sqlite3 chartbot.db 'SELECT C +OUNT(*) AS Anzahl, handle FROM channels where timestamp >= 1310478879 + and channel = 1 GROUP BY handle ORDER BY Anzahl DESC LIMIT 5' 463|frank001 307|SidVicious 272|Lisebeth 204|Shawn 149|albi real 0m0.349s user 0m0.312s sys 0m0.036s
Thanks for looking!use DBI; my $db = DBI->connect("dbi:SQLite:dbname=/root/chess/icc/chartbot/char +tbot.db", "", ""); $sth = $db->prepare ("SELECT COUNT(*) AS Anzahl, handle FROM channels +where timestamp >= 1310478879 and channel = 1 GROUP BY handle ORDER B +Y Anzahl DESC LIMIT 5"); $sth->execute (); while (my @z = $sth->fetchrow_array ()) { $handle = $z[1]; $count = $z[0]; print "$handle ($count)\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Very slow SQLite driver
by moritz (Cardinal) on Aug 12, 2011 at 18:41 UTC | |
by raschu (Initiate) on Aug 13, 2011 at 06:04 UTC | |
|
Re: Very slow SQLite driver
by tmaly (Monk) on Aug 15, 2011 at 13:57 UTC |