X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4CF84D1C979 for ; Wed, 3 Dec 2003 05:28:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 65407-06 for ; Wed, 3 Dec 2003 01:28:01 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 8624FD1BC62 for ; Wed, 3 Dec 2003 01:28:00 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hB35S0bI030689 for ; Wed, 3 Dec 2003 05:28:00 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hB354Seo028290 for pgsql-admin@postgresql.org; Wed, 3 Dec 2003 05:04:28 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.admin Subject: Re: PGSQL and DNCL Date: Wed, 03 Dec 2003 00:01:22 -0500 Organization: cbbrowne Computing Inc Lines: 35 Message-ID: References: <868350000.1070406432@gnarzelwicht.delirium-arts.de> <3FCD6449.4090103@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:EQU7I21jtPMc6MxqU6H9HKMeMKM= To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/41 X-Sequence-Number: 11549 After a long battle with technology, renneyt@yahoo.com (Renney Thomas), an earthling, wrote: > Has anyone any experience with PGSQL 7.x and implenting the FTC > do-not-call list - which is about 50 million 10 digit N. American > phone numbers? If so what structures have you used and what have you > done interms of performance tweaks? Is there an equivalent to Oracle's > IOT (index organized tables) in PGSQL? There is a PostgreSQL keyword called "CLUSTER" which clusters a table according to an index. That organizes the table based on a (specified) index. All US and Canada phone numbers fit into 2^34, which is regrettably slightly larger than 2^32. It is highly unfortunate that 2^31 is only about 2.1 billion, because it would be Really Sweet to be able to express the phone numbers as 32 bit integers. Using 32 bit ints would be GREATLY efficient because that fits with common register sizes. What you might do would be to create a table like the following: create table do_not_call ( first_8_digits integer, last_digit int2 ); create index fast_index on do_not_call(first_8_digits); And you'd put the first 8 digits into the obvious field. The index would get you to the right page of the index Right Quick, and the structure will be reasonably compact. It's a useful way of thinking to try to make use of the HIGH efficiency of having a 32 bit value express most of what you need... -- let name="cbbrowne" and tld="ntlug.org" in name ^ "@" ^ tld;; http://www.ntlug.org/~cbbrowne/lisp.html Why do we drive on parkways and park on driveways?