Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e84us-00024a-F0 for pgsql-performance@arkaria.postgresql.org; Fri, 27 Oct 2017 13:43:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e84ur-0001Kb-Ry for pgsql-performance@arkaria.postgresql.org; Fri, 27 Oct 2017 13:43:17 +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 1e6pJY-0001MD-Vl for pgsql-performance@postgresql.org; Tue, 24 Oct 2017 02:51:37 +0000 Received: from mail-me1aus01on0097.outbound.protection.outlook.com ([104.47.116.97] helo=AUS01-ME1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e6pJT-0002RD-Ce for pgsql-performance@postgresql.org; Tue, 24 Oct 2017 02:51:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sunpay.onmicrosoft.com; s=selector1-sunpay-com-au; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vsLlptQn+6LhLqaJlfG8EL9bNap7zetfC+QlZ0zq1KA=; b=a4N3T2+LhjpSWlRQ1mL6ot9S/zcEfy9woqHF8XSUWtuKlnDatp3mUucZ5hiNfUtLARg6fUrbgVzjPfLASrftIoNBcYfV5HSOlvy3VJt5ODIhfWnkgu2pp1BUwsf8WM/eyeXN0mLMAlkI4JHnnzvfejFHLBdWQonRmBBJK5Wbh2Y= Received: from MEXPR01MB1334.ausprd01.prod.outlook.com (10.171.18.9) by MEXPR01MB1334.ausprd01.prod.outlook.com (10.171.18.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Tue, 24 Oct 2017 02:51:26 +0000 Received: from MEXPR01MB1334.ausprd01.prod.outlook.com ([10.171.18.9]) by MEXPR01MB1334.ausprd01.prod.outlook.com ([10.171.18.9]) with mapi id 15.20.0156.006; Tue, 24 Oct 2017 02:51:26 +0000 From: Jason Borg To: "pgsql-performance@postgresql.org" Subject: Row-level security performance Thread-Topic: Row-level security performance Thread-Index: AdNMcXsrZVGSyTbBQVSvN/RxT+y4ww== Date: Tue, 24 Oct 2017 02:51:26 +0000 Message-ID: Accept-Language: en-AU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=jasonb@sunpay.com.au; x-originating-ip: [118.208.84.163] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MEXPR01MB1334;6:wYlqicG1D3r7Rs86MBQV183NMfYvAiM/wAOsjGy42REMH8H3J4eBCXLwTUWmTKYyg+QiXLTNGBYOLAmraBNivOG8Oq6kMbfEcfryTGLFQR0XxQ8oSixavFNtxGKRB3Hwj2SSUKPpbIdoDikBT5omaRJs6gjHAvkIEKIBf9Dd1hAaZBZUMPbJQvuvaH1E87k6dhhJEFAoxuC7msuQOECUu1Pa2FVchRPzG8PVM33SM138wOl5mm083+60oT8djPNZl1uQg309IFs3NRBdc0Ux9RDqJ0xF/RPNqAzYiRVjXDfceyOLdiO7cWI9jY1FibMJdvMLqDK9bUTGE8QoRU07yQ==;5:aigABxiER/9egacYyzzxx9UUWOU41UckpziQpfHe1V5kxr6WS05YJNA1dl+8aEgW7R2G6DZkie51JqOd/SHplKiiBUVYOL2m+cU78jJZaHyi/N8KZTKU5kJtlrcBgrzkobHRafY6bNe0jqS/5VdCmw==;24:jCGdCy5j+LT2ThTMdl6wvoypKswJOtTdnQsJzVtvUvPzLkN4lB0TO9w2mX+vDYegZP1hVqN+cpzb1zCH6UknV69w+iDvvYEnY6OIxdyjd7k=;7:spX0THWA/lmq45+m1u8d/ARmW60a6omS1KR8suZNS6PqmiA6kB7Fco2oq5ych9WQPumerN4jiDkn0LmyshZ5+c9VWSldheCcdZeXIZoH0UziX6jJsNLcq3k0Yt2T2mwZwCP2H0zwQQSK1/kHd5nHute4/xcBeVd9wt7cESAbv/POluEblCCWLI2+ns1TwloYglSHxqIXx3OSDENcvC99+uqQ/Bqb9tSMj6tSv7tetIg= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 800e7a13-cee3-4d99-e801-08d51a8a1e98 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4603075)(4627075)(201702281549075)(2017052603199);SRVR:MEXPR01MB1334; x-ms-traffictypediagnostic: MEXPR01MB1334: x-exchange-antispam-report-test: UriScan:(192374486261705)(101568727142576); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(3231020)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(2016111802025)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201703061421075)(6072148)(6043046)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MEXPR01MB1334;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MEXPR01MB1334; x-forefront-prvs: 047001DADA x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(189002)(377424004)(199003)(68736007)(15650500001)(6306002)(508600001)(97736004)(4001150100001)(3846002)(102836003)(6506006)(6116002)(2501003)(74482002)(86362001)(53936002)(9686003)(99286003)(6436002)(2351001)(55016002)(77096006)(189998001)(50986999)(54356999)(74316002)(42882006)(5660300001)(6916009)(33656002)(81166006)(81156014)(8676002)(7696004)(14454004)(2906002)(8936002)(305945005)(3480700004)(101416001)(2900100001)(7736002)(3660700001)(5640700003)(25786009)(3280700002)(105586002)(66066001)(106356001);DIR:OUT;SFP:1102;SCL:1;SRVR:MEXPR01MB1334;H:MEXPR01MB1334.ausprd01.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: sunpay.com.au does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sunpay.com.au X-MS-Exchange-CrossTenant-Network-Message-Id: 800e7a13-cee3-4d99-e801-08d51a8a1e98 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2017 02:51:26.3314 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0936758c-5ada-4e7a-bea2-e42588068b25 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MEXPR01MB1334 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 Hi, I see in the v10 release notes (2017-10-05) that there's been a change to "= Improve performance of queries affected by row-level security restrictions"= . I am using RLS in a Postgres 9.5 database and am seeing some very bad per= formance when joining tables. Upgrading this DB to v10 shows a huge perform= ance increase in some cases where RLS has proven to be an issue, but not al= l. I see here (https://www.postgresql.org/message-id/14730.1508278004%40sss.pg= h.pa.us), that Tom Lane (author of the commit for the aforementioned releas= e note) remarked on 2017-10-17: "I would *not* recommend RLS if you can equ= ally well stick the equivalent conditions into your queries. There is way = too much risk of taking a serious performance hit due to a bad plan." What's the current advice, and future plans for row-level security performa= nce optimisations? Though things have improved in v10, is there likely to always be that risk = of a bad plan arising? Regards, Jason Borg. --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance