Hey all,
I encounter a major problem: I've running Postgres 7.1 on a Sun 220R
(with only one processor). Postgres has a database with a table with
more than 300000 rows. The lay-out of my table is:
timestamp | interface | datain | dataout
I created indexes on the first two fields (timestamp and interface).
I've written a perl script that fetches data from the DB.
I do it the following way:
SELECT SUM(datain), SUM(dataout) FROM traffic_counters WHERE timestamp
LIKE '$yr-$mon-$day $hour:$minute%' AND interface LIKE '%$billingtable%'";
Now the problem is that it takes about ten seconds to get only a single
result... There are 24 hours in one day, so you can see that my script
runs for quite a time...
Is there a way to speed up thing (a lot)?
Thanx guys!
--
Kind regards,
Wim De Hul
Belgacom Belbone
--------------------------------
Mail : wdh@belbone.be
Mobile : +32 479 952004
Ripe : WDH25-RIPE
Registered Linux User: #260015
--------------------------------