Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 463762E0151 for ; Fri, 11 Apr 2008 11:38:57 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 60751-05-5 for ; Fri, 11 Apr 2008 11:38:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by developer.postgresql.org (Postfix) with ESMTP id 3749C2E015F for ; Fri, 11 Apr 2008 11:34:16 -0300 (ADT) Received: from perhan.alvh.no-ip.org (200-126-91-169.bk6-dsl.surnet.cl [200.126.91.169]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m3BEYkwr012000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Apr 2008 07:34:50 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 1505F47C55; Fri, 11 Apr 2008 10:25:44 -0400 (CLT) Date: Fri, 11 Apr 2008 10:25:44 -0400 From: Alvaro Herrera To: Jon Stewart Cc: pgsql-performance@postgresql.org Subject: Re: Creating large database of MD5 hash values Message-ID: <20080411142543.GA6442@alvh.no-ip.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Fri, 11 Apr 2008 07:34:51 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/152 X-Sequence-Number: 29645 Jon Stewart escribió: > Hello, > > I am creating a large database of MD5 hash values. I am a relative > newb with PostgreSQL (or any database for that matter). The schema and > operation will be quite simple -- only a few tables, probably no > stored procedures -- but I may easily end up with several hundred > million rows of hash values, possible even get into the billions. The > hash values will be organized into logical sets, with a many-many > relationship. I have some questions before I set out on this endeavor, > however, and would appreciate any and all feedback, including SWAGs, > WAGs, and outright lies. :-) I am trying to batch up operations as > much as possible, so I will largely be doing comparisons of whole > sets, with bulk COPY importing. I hope to avoid single hash value > lookup as much as possible. If MD5 values will be your primary data and you'll be storing millions of them, it would be wise to create your own datatype and operators with the most compact and efficient representation possible. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support