Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edh7E-0006cy-6S for pgsql-general@arkaria.postgresql.org; Mon, 22 Jan 2018 18:46:44 +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 1edh7D-0002tE-Pi for pgsql-general@arkaria.postgresql.org; Mon, 22 Jan 2018 18:46:43 +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 1edh7C-0002t4-VW for pgsql-general@lists.postgresql.org; Mon, 22 Jan 2018 18:46:43 +0000 Received: from omr-a017e.mx.aol.com ([204.29.186.68]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1edh7A-0006R9-4r for pgsql-general@postgresql.org; Mon, 22 Jan 2018 18:46:41 +0000 Received: from mtaomg-mac01.mx.aol.com (mtaomg-mac01.mx.aol.com [172.26.222.207]) by omr-a017e.mx.aol.com (Outbound Mail Relay) with ESMTP id 73D083800092; Mon, 22 Jan 2018 13:46:38 -0500 (EST) Received: from core-aax04b.mail.aol.com (core-aax04.mail.aol.com [10.76.1.193]) by mtaomg-mac01.mx.aol.com (OMAG/Core Interface) with ESMTP id 3258C38000089; Mon, 22 Jan 2018 13:46:38 -0500 (EST) Received: from 208.185.19.251 by webjas-vaa078.srv.aolmail.net (10.96.33.81) with HTTP (WebMailUI); Mon, 22 Jan 2018 13:46:37 -0500 Date: Mon, 22 Jan 2018 13:46:38 -0500 From: Rakesh Kumar To: michael@kruegers.email, pgsql-general@postgresql.org Message-Id: <1611f31928f-1d2f-3419@webjas-vaa078.srv.aolmail.net> In-Reply-To: References: Subject: Re: Slow alter sequence with PG10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-MB-Message-Source: WebUI X-MB-Message-Type: User X-Mailer: JAS STD X-Originating-IP: [208.185.19.251] x-aol-global-disposition: G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com; s=20150623; t=1516646798; bh=th09znC6Rq5YDez4LX+NWnxcicLe7YtUmgLbxDVWEOA=; h=From:To:Subject:Message-Id:Date:MIME-Version:Content-Type; b=cukwMI2RQAuvnTPC6ByUHqLb7qVibKNciwsbGfgroHucEprOvWn9GDzYaCL56hStt nmEAdln7yKiZIXK+xBXinoVw1ExHu3THOtF3EH1nH2exd3jHKoQmegfqlD3glXKF8c J8iOLbAACKcVWAC4gpGYdyBLluCa3m6pPMVHuHm8= x-aol-sid: 3039ac1adecf5a66318e3049 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk why are you not using CACHE clause which is precisely for the purpose : cache The optional clause CACHE cache specifies how many sequence numbers are to be preallocated and stored in memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e., no cache), and this is also the default.