Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebQEP-0003jn-Te for pgsql-performance@arkaria.postgresql.org; Tue, 16 Jan 2018 12:20:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebQEO-0002Qm-SA for pgsql-performance@arkaria.postgresql.org; Tue, 16 Jan 2018 12:20:44 +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 1ebQEO-0002Qd-LL for pgsql-performance@lists.postgresql.org; Tue, 16 Jan 2018 12:20:44 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ebQEM-0007Ya-3n for pgsql-performance@lists.postgresql.org; Tue, 16 Jan 2018 12:20:44 +0000 Received: from [10.8.0.146] ([185.40.248.10]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPSA (Nemesis) id 0MN4u0-1eUpaC1GzQ-006gWs for ; Tue, 16 Jan 2018 13:20:40 +0100 Subject: Re: Query is slow when run for first time; subsequent execution is fast To: pgsql-performance@lists.postgresql.org References: From: Thomas Kellerer Message-ID: Date: Tue, 16 Jan 2018 13:20:39 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:PqvxSuc2xIZ+Zvba+ipV3eRzsfXFPoIOdZMffLq1aitbepAFObt QfXHnylSk3t1R3MjY2dQE15mNJdImCBwd1A84BHNBvEfr7KJJ/8zQ310bYy9t/ygoVxnuGn zIW9hayfVn6QP6vFlcB4tNixVnVKDpdtUZMgFqZkZkp+hYMa9QQCErEdOIdZpNzE3KzCPaC CUknfL3wWZwvO91CMB4OQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:l1R3bSnwkD0=:ZQe/B4W85JzFArCAkkCJDQ Xgc3zTN6HdsJ9JBoHSUZD3AELePpuwko5BUF9ahupMbMmH8NpT+i9vl4FfoOXaO7OftINkO3h 9uiB40w5qokf7Wf2qJRd/lL/wfF669XSzuQWVXbfYfJ99VrEFElFImyBQzt/uFgzL6r3XgwbM HgYwTyhNm2SBINDPWUaV1yMy54T263Vd/rYkH7mqCIqafxk1BJEYhOeuqRw0z8GN3NQZyWQo/ mXRU6yV7ZZb8gKq15O08I6S72fsZT2bGAI87bWtLwUjQ4EuC9IU1YJ9M2sxmYlNqCXvY+rJgk j8v21vbQkkMevnoCmR9fcLx11sln89CfSvldNF1nnyKT3322fd4lZyN3p580rfOajLQZO2Gyn LWOYMA2f/yQaTw7jxiMC/BTgDA48NFkOdILxl+lW95+H+cmYId3sP1S7j9pHw7/RycON3aCmw WZRQgj3n+G4RY9Mu4OzdrD/am+Nj3NAZtEQ7fKeqzsmW+doCIPiH2SzXUE8eK56wsbyd7NuOB W9t2u5yRJUmmeIM4PaX4GO1dPY1fbdlgJ9owhgvqFrznks7hhur0nJ5HgXAIGWh0mDlaRf+Cc FiBghRX7RaVhOCNGjKo2CQlK7QvBqns2GVTd286mptRrgR1O1oZFZCvoextxFYeCnuKbpJDLa AjpT1NPV7GWIuyXt9JoDBs/ScuB1eElpEqv/ExCSsJ7TZhe49J18UstjvtzeMCvi8b55f88pt qgfJSkfXl5g9C8L+n614LzJJS+RpN4QGQE6fGBIsHAseyUeGQwv+GRcU1IE= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Nandakumar M schrieb am 12.01.2018 um 09:03: > Even if I close a connection and open a new one and execute the same > query, the planning time is considerably less than the first time. > Only when I restart the Postgres server then I face high planning > time again. Yes, because the data is cached by Postgres ("shared_buffers") and the filesystem.