Where to count

From: "H(dot) Wade Minter" <minter(at)lunenburg(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Where to count
Date: 2001-10-10 19:46:52
Message-ID: 20011010154342.Y11015-100000@bunning.skiltech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm running a DB query on a database of firewall log entries (right now
around 700k rows). What I want to do is pull out some common entries, as
well as the number of times that they occur in the table.

Right now, I'm doing a query like:

select source,destination,service,count(*) FROM logs WHERE action='$type'
GROUP BY source,destination,service ORDER BY count DESC LIMIT $num;

This is a little more advanced than I'm used to doing, so I'm wondering if
that query is the best way to get that data, or if there's another way of
doing it.

Thanks,
Wade

--
Do your part in the fight against injustice.
Free Dmitry Sklyarov! http://www.freesklyarov.org/
Fight the DMCA! http://www.anti-dmca.org/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Link 2001-10-10 19:52:02 Re: PG mailing list problems (was Re: Support issues)
Previous Message David Link 2001-10-10 19:46:17 Performance problem with 50,000,000 rows