pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pomarede Nicolas <npomarede@corp.free.fr>
Cc: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: Best way to index IP data?
Date: Fri, 11 Jan 2008 19:51:19 -0500
Message-ID: <28998.1200099079@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.64.0801112336500.30027@localhost>
References: <200801101614.54729.kevin@kevinkempterllc.com>
	<DA6DE53A-2F69-46F3-8C96-B341ADCDDFAF@blighty.com>
	<36e682920801101541o7626bbddj428617144240c554@mail.gmail.com>
	<Pine.LNX.4.64.0801111025390.30762@localhost>
	<13179.1200064791@sss.pgh.pa.us>
	<20080111162747.GT5294@mathom.us>
	<24044.1200082058@sss.pgh.pa.us>
	<20080111212703.GU5294@mathom.us>
	<20080111213710.GD8260@alvh.no-ip.org>
	<20080111220235.GX5294@mathom.us>
	<20080111222403.GA7527@crankycanuck.ca>
	<Pine.LNX.4.64.0801112336500.30027@localhost>

Pomarede Nicolas <npomarede@corp.free.fr> writes:
> And it's true for IPv6 too, storing an IP that refer to an end point and 
> not a subnet is requiring twice as much data as needed, because the 
> netmask would always be ff:ff:ff:..:ff
> So, for people dealing with large database of IPs, it would be nice to be 
> able to save 50% of the corresponding disk/cache/ram space for these IPs.

There seem to be a number of people in this thread laboring under the
illusion that we store a netmask as a mask.  It's a bit count (think
/32 or /128) and occupies a whole one byte on disk.  Killer overhead,
for sure.

			regards, tom lane



view thread (42+ messages)  latest in thread

Message-ID: <28998.1200099079@sss.pgh.pa.us>
Permalink:  ../28998.1200099079@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28998.1200099079@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, npomarede@corp.free.fr, ajs@crankycanuck.ca
  Subject: Re: Best way to index IP data?
  In-Reply-To: <28998.1200099079@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox