Thread: Help on using hyperloglog in Postgresql

Help on using hyperloglog in Postgresql

From
"Abdlhamed, Mohamed"
Date:

I am new to PostgreSQL and SQL. I want to apply HLL in PostgreSQL on a table contain traffic information each stored in separate column, so I want to estimate the cardinality of every distinct IP. the cardinality here is how many ports contacted distinct per IP. IPs stored in 'Destination' column and ports stored in 'DetsPort'. can anyone help me with full code and steps please!

regards.

 



Important Notice: the information in this email and any attachments is for the sole use of the intended recipient(s). If you are not an intended recipient, or a person responsible for delivering it to an intended recipient, you should delete it from your system immediately without disclosing its contents elsewhere and advise the sender by returning the email or by telephoning a number contained in the body of the email. No responsibility is accepted for loss or damage arising from viruses or changes made to this message after it was sent. The views contained in this email are those of the author and not necessarily those of Liverpool John Moores University.

Re: Help on using hyperloglog in Postgresql

From
Andreas Kretschmer
Date:
Abdlhamed, Mohamed <M.A.Abdlhamed@2013.ljmu.ac.uk> wrote:

> I am new to PostgreSQL and SQL. I want to apply HLL in PostgreSQL on a table
> contain traffic information each stored in separate column, so I want to
> estimate the cardinality of every distinct IP. the cardinality here is how many
> ports contacted distinct per IP. IPs stored in 'Destination' column and ports
> stored in 'DetsPort'. can anyone help me with full code and steps please!

if i understand you, you have a table with 2 columns, 'destination' and
'destport', right? And you want to know how many ports per destination
there are, right?


select
  destination
  , count(destport)
from <insert_the_table_name_here>
group by destination;




Regards, Andreas Kretschmer
--
Andreas Kretschmer
http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services