Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCnR5-00043J-Pt for pgsql-general@arkaria.postgresql.org; Thu, 18 Feb 2021 17:49:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lCnR3-0006Tg-Nt for pgsql-general@arkaria.postgresql.org; Thu, 18 Feb 2021 17:49:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCnR3-0006Pk-Do for pgsql-general@lists.postgresql.org; Thu, 18 Feb 2021 17:49:53 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCnR0-0003QT-II for pgsql-general@postgresql.org; Thu, 18 Feb 2021 17:49:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OPN08W0S+rwNewLEsxW4I6U5T1lSu1EmCVGP7J5Q7yI=; b=EKhq2i4cAy3yze9umhMwbzl+pC LDUsi8JePvoh3+yjIZJr0Cqh9oRtJYzeCIXHingXu0BU8geTlKMQ0+TKKg+7HyonIXjvhbkghfAC1 /7sbwxICmzdCLiqHkRVTTmLbR9ygSeQuskJ8Z1619GUBcC+Gm68/huL2q+SQmvcR1tQ8=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1lCnQy-0006Wa-Us; Thu, 18 Feb 2021 18:49:48 +0100 Date: Thu, 18 Feb 2021 18:49:48 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Michael Lewis Cc: Paul van der Linden , pgsql-general Subject: Re: Slow index creation Message-ID: <20210218174948.GA17102@depesz.com> Reply-To: depesz@depesz.com References: <20210217184808.GA14032@depesz.com> <20210218091553.GA25223@depesz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Feb 18, 2021 at 10:24:25AM -0700, Michael Lewis wrote: > [1]https://www.depesz.com/2010/03/18/profiling-stored-proceduresfunctions/ > > Thanks for this reference. I enjoy your blog, but haven't made the time to read all the archives somehow. Stuff doesn't stick very > well when it isn't yet "needed" info besides. > I have seen overhead from 'raise notice' in small functions that are sometimes called many thousands of times in a single query, but > hadn't done the test to verify if the same overhead still exists for raise debug or another level below both client_min_messages > and log_min_messages. Using your examples, I saw about .006 ms for each call to RAISE DEBUG with a client/log_min as notice/warning. Sure, this overhead is definitely possible, but kinda besides the point - there will be some slowdowns in other places, and it will be good to track them. That's why I suggested to do it on small sample of data. Best regards, depesz