Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agCzl-00078O-Ht for pgsql-performance@arkaria.postgresql.org; Wed, 16 Mar 2016 15:04:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agCzk-0002yr-WE for pgsql-performance@arkaria.postgresql.org; Wed, 16 Mar 2016 15:04:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agCzk-0002yl-GM for pgsql-performance@postgresql.org; Wed, 16 Mar 2016 15:04:20 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1agCzc-0005QT-MY for pgsql-performance@postgresql.org; Wed, 16 Mar 2016 15:04:19 +0000 Received: by mail-wm0-x231.google.com with SMTP id p65so194225448wmp.1 for ; Wed, 16 Mar 2016 08:04:12 -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=Gnn2zAEZoBLJgtLb4u8gUtGjn5QQkEUI3EEQNRFFXBU=; b=dIeqxEVFfbAjUGK5MahtDbj+g0jcv34iaOdX4Ue6hyDLmT9iCazx3tFuaCNELKPDx6 FBeR58wF/KzTcmlDdz93j3A3tQs9PLy5UD6Cxt7ayVuf3S1pH0EVPyEoZNCftoB7L9ce TX35hkknL0P1p+4gHofJm70TKsHpxUiR/XB+B9b2rmkq+5aKo/kj0mzTXUo9gQoqvOiJ 0nbTIAaQwfsaWn9JTF/VHdQw25hrpax2pyoiarr+atVdbcuac6BGYa+PYWKr4e8C7sm6 FiNGrRHQyF3vP+R2b/SHwM0ghAWyHcDEow3tPL5av5FHY7AzSVJ9fyjOgcnTnwXdBmej Mrxg== 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=Gnn2zAEZoBLJgtLb4u8gUtGjn5QQkEUI3EEQNRFFXBU=; b=KH4Jrnz81j7Fgm3cyYwQwnfPBE4HmrGDCsdhCGZFuiM6TV+1+SC/dqsjYkTm+MY4o9 Oc2R1b0PHai/Not5NjLeG17sr6VAz6K/IPynVd26hCyNCb1X7gmd0ErJUEvwNZFtkMMw LdLVz+Qd/B/tn7kCHxbMrrx1jQk1UfZzZELGBmJ17pVMym1S88JKMdE85bpPALQYRDro VfeHJd6cELi3ikhR2s2T5N6lIHGKHn3uaGv/mSRd47DjSdRtEw48sqxGmoX8ukwTrl5t rot9+KI4NlxJlxt0S04NkdQmeOUFm8nYzSqmaSJVrRyPrO3s+aYdnoU8ltgNrO0wI7dw /ICQ== X-Gm-Message-State: AD7BkJKAvXY7VMjE4plsxbhe2H4lCHYGGYkcvtBYJFTIWy1Eg1WhslNgyazPqgpjBSRWpg== X-Received: by 10.194.86.202 with SMTP id r10mr5024985wjz.113.1458140651348; Wed, 16 Mar 2016 08:04:11 -0700 (PDT) Received: from wgaybook.corp.wargaming.local (by1-office.wargaming.net. [178.172.239.249]) by smtp.gmail.com with ESMTPSA id p191sm27628749wmb.0.2016.03.16.08.04.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Mar 2016 08:04:10 -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: Date: Wed, 16 Mar 2016 18:04:08 +0300 Cc: Andreas Joseph Krogh , pgsql-performance Content-Transfer-Encoding: quoted-printable Message-Id: <9D98454D-D4E5-457F-8F5C-F49526BFA9FA@gmail.com> 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 17:52, Evgeniy Shishkin wrote: >=20 >=20 >> 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. >=20 > I don't see how gin inability to return sorted data relates to index cond= ition. > In fact i tried to reproduce the example, > and if i change folder_id to int from bigint, then index condition with f= older_id is used >=20 > Index Cond: ((fts_all @@ '''hi'''::tsquery) AND (folder_id =3D 1)) >=20 Looks like documentation http://www.postgresql.org/docs/9.5/static/btree-gi= n.html is lying about supporting int8 type >=20 >>=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 sortin= g? >>=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.or= g) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-performance >=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