Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hsBHa-00005F-1X for pgsql-general@arkaria.postgresql.org; Mon, 29 Jul 2019 19:26:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hsBHY-0002PG-0X for pgsql-general@arkaria.postgresql.org; Mon, 29 Jul 2019 19:26:04 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hsBHW-0002Ny-7K for pgsql-general@lists.postgresql.org; Mon, 29 Jul 2019 19:26:03 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hsBHS-0003Dp-KN for pgsql-general@lists.postgresql.org; Mon, 29 Jul 2019 19:26:01 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 78AD72108A; Mon, 29 Jul 2019 15:25:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 29 Jul 2019 15:25:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=h qjeh1vkhOrU5LM+u7uc+AiHEZxI08XR3rwq9LB7dMM=; b=JeKqMcmpMHNIfNt+C mb6sJhDwx/tbaRuT4hUF3CZqijTburO7fYGYrkltQWvuLw09XgC3g3sdCVgiAU65 52MMUUCEvwgi4DlgObEw3kzAoQciuXuseDZTJivqLjPV8pRBGTWCBpAaWYp1EUdu c4mxq32RrLYw74aycMyt9jMSPx1YIs/Wqzy1urDB+iWDwaga4VkRIugNSckxb8wn qeAIPwzoUchUzy5dqWplY3ptNCWmYiHuQCBZ1R7QEKUIIOW794w2SO92/v6495SW YrpHYYNP1GSZUyJ6eERmdaHk6oErioOqZUiBE8TgexxjHQoVGke9nd2NYW/ii5c8 rULPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=hqjeh1vkhOrU5LM+u7uc+AiHEZxI08XR3rwq9LB7d MM=; b=G/GclAW0Dew5xoO1Fz+J1PuRHIcX4VDSy79Tgbl8znH+dnV+7/2X1/eE2 hz6jCa0D/t6M0LklZqrpJA0cCafIgBDUDp7avqj501mHzZfxSrUrwNxJ/S+4Lh3u FtzoLUFE6mlxF2TKywTU+3TaHXyi6j5Iz3gOCFL9lKyCp+AkfF6UazrnPoLZZYQs jTNq/UEhn0dt5r38VRUWDLuCwpC5+fcKn2ywEsTksN/NBWh79KlRAhU/OYqY53Hs DVipwGOznp1CQHy6F2kNgGyy4YnmqQKel3Cn8VPuzQplRZTOl3EKWuuPrweN9yZ6 v2DKQPkA/1/eed+rhIsULy15eN1UA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrledugddufeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepjedurddvuddvrdduhedtrddvtddvnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsth gvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 9ED8938008A; Mon, 29 Jul 2019 15:25:54 -0400 (EDT) Subject: Re: Reproducing query plans in empty database: can I just copy stats and settings? To: Guyren Howe , "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver Message-ID: <7e758c6c-6e6f-d6b4-6ce5-55ac2bb95586@aklaver.com> Date: Mon, 29 Jul 2019 12:25:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/29/19 12:07 PM, Guyren Howe wrote: > I work with Protected Health Information so have restricted access to an > important database. > > I would like to look into index and query changes for that database. It > occurs to me that if I was able to reproduce the statistics and cost > settings for the database, then Explain would produce identical results > to the production database. > > Can do this? Any other advice? So what defines restricted access? If you can't see/use the data in the production database in your test database I'm not sure how copying the statistics/cost settings is going to help. -- Adrian Klaver adrian.klaver@aklaver.com