Where to count

Поиск
Список
Период
Сортировка
От H. Wade Minter
Тема Where to count
Дата
Msg-id 20011010154342.Y11015-100000@bunning.skiltech.com
обсуждение исходный текст
Список 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/


В списке pgsql-general по дате отправления:

Предыдущее
От: sanjay.dixit@nebula.ie
Дата:
Сообщение: Problem : Pound to Hash sign
Следующее
От: David Link
Дата:
Сообщение: Performance problem with 50,000,000 rows