Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VqtdL-0002Sz-0r for pgsql-performance@arkaria.postgresql.org; Wed, 11 Dec 2013 23:56:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VqtdK-0001wS-Dx for pgsql-performance@arkaria.postgresql.org; Wed, 11 Dec 2013 23:56:02 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VqtdJ-0001wL-7B for pgsql-performance@postgresql.org; Wed, 11 Dec 2013 23:56:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VqtdG-0002gw-VO for pgsql-performance@postgresql.org; Wed, 11 Dec 2013 23:56:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rBBNtv8Z017032; Wed, 11 Dec 2013 18:55:57 -0500 From: Tom Lane To: Craig James cc: Janek Sendrowski , "pgsql-performance@postgresql.org" Subject: Re: ORDER BY using index, tsearch2 In-reply-to: References: Comments: In-reply-to Craig James message dated "Wed, 11 Dec 2013 15:38:09 -0800" Date: Wed, 11 Dec 2013 18:55:57 -0500 Message-ID: <17031.1386806157@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Craig James writes: > A GIST is a tree, but there's no notion of ">" or "<", only yes/no at each > tree branch. In this regard a GIST index is more like a hash table. You > can't use a hash table to sort. It doesn't make sense. Recent versions of PG do allow GIST indexes to be used to satisfy K-nearest-neighbor queries, if the operator class supports that. (This requires that the tree partitioning be done on some notion of distance, and even then there'll be some traversal of irrelevant index entries; but it way beats a full-table scan, or even full-index scan.) But I'm not entirely sure if that's what the OP is asking about. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance