Re: Help on using hyperloglog in Postgresql - Mailing list pgsql-novice

From Andreas Kretschmer
Subject Re: Help on using hyperloglog in Postgresql
Date
Msg-id 20161007130243.GA6132@tux
Whole thread Raw
In response to Help on using hyperloglog in Postgresql  ("Abdlhamed, Mohamed" <M.A.Abdlhamed@2013.ljmu.ac.uk>)
List pgsql-novice
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


pgsql-novice by date:

Previous
From: "Abdlhamed, Mohamed"
Date:
Subject: Help on using hyperloglog in Postgresql
Next
From: Binand Sethumadhavan
Date:
Subject: \COPY in script