Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agCoc-0006Nl-Lz for pgsql-performance@arkaria.postgresql.org; Wed, 16 Mar 2016 14:52:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agCoc-00061R-8K for pgsql-performance@arkaria.postgresql.org; Wed, 16 Mar 2016 14:52:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agCob-00061L-Ox for pgsql-performance@postgresql.org; Wed, 16 Mar 2016 14:52:49 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1agCoY-0000lf-Lb for pgsql-performance@postgresql.org; Wed, 16 Mar 2016 14:52:48 +0000 Received: by mail-wm0-x231.google.com with SMTP id p65so76269376wmp.0 for ; Wed, 16 Mar 2016 07:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uPXNulfGdMv59L/C0XtBgeKGQDdoaop8W7//kKTYgsQ=; b=Vn8tMfONH9k8PwLOdXztgpgZ89ackjGKLtnTZ2+kuPk//4gbf8zuWky4d5SGg0+Ujs wEakuT2EkZnwqP7x25y3hf01tzxaUyZ+OxXrlDYAVP6EjydwTuPGcgKLt7ALoMqYzJyb XW82WAgiRjHmSeXTNti5b3/ztBTdKubIzHa//4VV+tgoKMMRc3wi3Knjlwado87GQqFf mjUj0KdH68Bl878sE80pjiZMsonyOEWaa9/+ULqK4lriu6SfG7uxG0/M1qgYG9b/txwT vmYr1+E2x6CKwS3V6mH4tCQ6hsci4drTSNffFaugi3iK1uDyNR+wIDDHNDM4aG/YGzlV NDCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uPXNulfGdMv59L/C0XtBgeKGQDdoaop8W7//kKTYgsQ=; b=LzL1kLisye2jBTeA5aR9r7rTCkavKg76og/vl14PosgPVak4eJkSn9hNKcrXdSrLyU N9szipbVIiney7vKForl5U185KJQ0pGMrFRGPt8aXpaexsQJJ8KbE3+omEtTTPg/1+Az eqtqFVX/56mII3WPlIpyJroWQ0bAOku8x+Wggpa7I6JVQpQbOjGtp/mULu83DuLS+23S TXLw/f1Rw34FcaSShKZ3gonfAUBz3ISy8p5MhiNKBQUKReZe7nnK9eHN/dvjPZvWsmIb qgTltxhWipowvZS2vB6g1QJGQ2FNejtGWaGGdJDwogorXEi1Rmil6iKBmt8JQgXODT/m hgkA== X-Gm-Message-State: AD7BkJLmpze+9BTdHTSX4MrsewP4JP1gw+V0RET0qjN93fj7n/KJc2qHBy0eyOcTKB2okw== X-Received: by 10.28.218.145 with SMTP id r139mr32322087wmg.52.1458139965078; Wed, 16 Mar 2016 07:52:45 -0700 (PDT) Received: from wgaybook.corp.wargaming.local (by1-office.wargaming.net. [178.172.239.249]) by smtp.gmail.com with ESMTPSA id hq2sm3421034wjb.3.2016.03.16.07.52.43 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Mar 2016 07:52:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: Searching GIN-index (FTS) and sort by timestamp-column From: Evgeniy Shishkin In-Reply-To: <27201.1458135447@sss.pgh.pa.us> Date: Wed, 16 Mar 2016 17:52:40 +0300 Cc: Andreas Joseph Krogh , pgsql-performance Content-Transfer-Encoding: quoted-printable Message-Id: References: <27201.1458135447@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3112) X-Pg-Spam-Score: -2.7 (--) 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 > On 16 Mar 2016, at 16:37, Tom Lane wrote: >=20 > Andreas Joseph Krogh writes: >> 1. Why isnt' folder_id part of the index-cond? >=20 > Because a GIN index is useless for sorting. I don't see how gin inability to return sorted data relates to index condit= ion. In fact i tried to reproduce the example, and if i change folder_id to int from bigint, then index condition with fol= der_id is used Index Cond: ((fts_all @@ '''hi'''::tsquery) AND (folder_id =3D 1)) >=20 >> 2. Is there a way to make it use the (same) index to sort by=20 >> received_timestamp? >=20 > No. >=20 >> 3. Using a GIN-index, is there a way to use the index at all for sorting? >=20 > No. >=20 >> 4. It doesn't seem like ts_rank uses the index for sorting either. >=20 > Same reason. >=20 > regards, tom lane >=20 >=20 > --=20 > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance