Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsxoC-0002E9-FK for pgsql-performance@arkaria.postgresql.org; Fri, 15 Sep 2017 21:05:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dsxoB-0000zg-Uz for pgsql-performance@arkaria.postgresql.org; Fri, 15 Sep 2017 21:05:55 +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 1dsxmN-0003vz-6g for pgsql-performance@postgresql.org; Fri, 15 Sep 2017 21:04:03 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dsxmK-0006a3-Mz for pgsql-performance@postgresql.org; Fri, 15 Sep 2017 21:04:02 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 19EE020C44; Fri, 15 Sep 2017 17:04:00 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Fri, 15 Sep 2017 17:04:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=7ugTZYqpj8fVG+mrG6S9eNagFPTRwDe90H6LUi+T76Q=; b=dIWULPW1 BMefOsK8w8xX+2/uI+4OoZtIfmO/i4ccawg4Q5PmQIaIlj6cVzeqldH86a4gZL8a zMDvQ1dcSNCsJxp4lyzz5iFDHHcxVWyLBXc6dXmsIlF2ZqEBy2CLUkTpctyhQtqy OMlvMfG+rlNLqDg7Z8dexphil+CJw8LFwHI0BdmsMOIECKR7mRKjydvyx37RbGUE A8SaXAxGMxCSbxKt6VsRH6IqMsMHd8ofPggtQlZqtHG5TqnBnuCTsV/63WZUSIjJ noSyAj3cfKby0+UpAqwgRNDVW3M8r3Q58MP+wAr5TGTZ1HU9hTVG5QSOwT+XaRqJ tffgxeEfUEhlLA== X-ME-Sender: X-Sasl-enc: 5lu0fPWCqbyT2PTMvsU1tr3bTl+kCr1lb+uEUwCc7vqZ 1505509439 Received: from android-ae68c67b940fd203.lan (unknown [136.24.76.72]) by mail.messagingengine.com (Postfix) with ESMTPA id 46B732459C; Fri, 15 Sep 2017 17:03:59 -0400 (EDT) Date: Fri, 15 Sep 2017 14:03:58 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <3138.1505508143@sss.pgh.pa.us> References: <3138.1505508143@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: query of partitioned object doesnt use index in qa To: pgsql-performance@postgresql.org,Tom Lane ,Mike Broers CC: David Rowley ,postgres performance list From: Andres Freund Message-ID: <862584A2-724B-4F5A-976F-6164AE61BBE5@anarazel.de> 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 September 15, 2017 1:42:23 PM PDT, Tom Lane wrote: >One thing you could consider doing about this is creating an index >on (body ->> 'SID'::text), which would prompt ANALYZE to gather >statistics >about that expression. Even if the index weren't actually used in the >plan, this might improve the estimates and the resulting planning >choices >enough to make it worth maintaining such an index. I'm wondering if we should extend the new CREATE STATISTICS framework to be= able to do that without requiring an index. I.e. allow expressions and add= a new type of stats that just correspond to what normal columns have. Cou= ld even create that implicitly for expression indexes, but allow to drop it= , if the overtrading isn't worth it. Andres --=20 Sent from my Android device with K-9 Mail. Please excuse my brevity. --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance