X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D7E58D8C9A for ; Fri, 9 Sep 2005 20:27:36 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91945-02 for ; Fri, 9 Sep 2005 23:27:33 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 92E24D8CA3 for ; Fri, 9 Sep 2005 20:27:34 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id EAC7D31F81; Sat, 10 Sep 2005 01:27:37 +0200 (MET DST) From: Ron Mayer X-Newsgroups: pgsql.sql Subject: Re: Indexing an array? Date: Fri, 09 Sep 2005 16:35:30 -0700 Organization: Hub.Org Networking Services Lines: 17 Message-ID: <43221C42.2060605@cheapcomplexdevices.com> References: <43206338.9020502@informatik.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org To: Silke Trissl User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050727) X-Accept-Language: en-us, en In-Reply-To: <43206338.9020502@informatik.hu-berlin.de> To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=-0.013 required=5 tests=[AWL=-0.013] X-Spam-Level: X-Archive-Number: 200509/136 X-Sequence-Number: 22683 Silke Trissl wrote: > As far I could read from the documentation - this should be possible. > But my question is, is there a kind of index on the array. If your needs are a bit more modest (say, a few thousands instead of billions) the stuff in contrib/intarray works well; and if you needed types other than integers you can you can look at intarray to see how to build indexes on them and what those indexes are useful for. > Lets say, I want to get element 2,675,345,328. Does Postgres have to > load the entire array into memory and then run through the 2.6 billion > characters to return the one I want or does Postgres have an index - as > where to find this element on disk? Wouldn't you rather expect an index to be useful for finding which rows match your query rather than for finding content within a row?