Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 77CFB2E0085 for ; Thu, 10 Apr 2008 11:49:07 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 36162-02-3 for ; Thu, 10 Apr 2008 11:49:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.186]) by developer.postgresql.org (Postfix) with ESMTP id B87E62E0054 for ; Thu, 10 Apr 2008 11:49:01 -0300 (ADT) Received: by rn-out-0910.google.com with SMTP id e11so34379rng.17 for ; Thu, 10 Apr 2008 07:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=BrQgLQZDx7Z6VOWOlYocywilMXpjGXn6PFkRJ6bDEjY=; b=OILEnhT+h3RJoo1MDBrbxDEaoscAVdgCdfPCgCkXPQKFa4MNhKTzla26jkzk95ez/Qfk+gK2erITYuDJ9AQ99j11C00LDmRkrZ1VOqV8evkfVHWk7oRrtiH8PzL615PALZP+jZFX24aCSAZC0uPrxLEmPFBsi6lbHB1AU/a6qmU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=I+RDUossgGoS7PlIj4IlWutQBLxbCyqVcoT3e4yEst12IdxR8RdLEASkLsdkw/ouPhGpunUrlot/thAoztuJy9Eop3sIS/qN3yMEMNIkDXceLZmx158it0v3Nf87Pe1dfwGMjug3S9Ijcv5CJeomV/GzO49tZgmfbDzv2aEuvus= Received: by 10.115.54.1 with SMTP id g1mr1894498wak.136.1207838939443; Thu, 10 Apr 2008 07:48:59 -0700 (PDT) Received: by 10.114.235.18 with HTTP; Thu, 10 Apr 2008 07:48:59 -0700 (PDT) Message-ID: Date: Thu, 10 Apr 2008 10:48:59 -0400 From: "Jon Stewart" To: pgsql-performance@postgresql.org Subject: Creating large database of MD5 hash values MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/128 X-Sequence-Number: 29621 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. 1. Which datatype should I use to represent the hash value? UUIDs are also 16 bytes... 2. Does it make sense to denormalize the hash set relationships? 3. Should I index? 4. What other data structure options would it make sense for me to choose? Thanks in advance, Jon