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 1hTUbw-0003ND-LG for pgsql-performance@arkaria.postgresql.org; Wed, 22 May 2019 17:01:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hTUbv-0005J4-Dz for pgsql-performance@arkaria.postgresql.org; Wed, 22 May 2019 17:01:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTUbu-0005Hw-Um for pgsql-performance@lists.postgresql.org; Wed, 22 May 2019 17:01:03 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTUbs-0002rs-Br for pgsql-performance@lists.postgresql.org; Wed, 22 May 2019 17:01:01 +0000 Received: by mail-wm1-x343.google.com with SMTP id j187so5168537wma.1 for ; Wed, 22 May 2019 10:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RWTVHKYOfdYsPf+q79AT6inzHJlFcuwDkIDiqFrGdFs=; b=EUjrUTLCO7jaSdiwm47UNScHzAIUuDvPOgDBFL5NSa+WhLgBr+2wl3uKcFlqGfwqUb NtHGawpXLBnE1lV9Bt1AeB+M5C0EEI3n2/j5IEFQsgzpX6fC9+RcqqnExevalszEEr1F zZMVuoZmPP2eCpG8Ylnb5GQcRBhLiq09uc6hLuGE0F8bJtx6bwfpm3JOwdxJhv2twJMS 4R8WEVZibyFpL95XbdIWcF4jcLWGBReCKkUC3CbM1sorb0mQoSFTTrL6kxMgrGbdHThK FOY8KyRMc9l0Z3FDSKgeFlgcI/hmje6TQHazi+adCRbzkJU6F3VETto36r7xKtQ6dQ3F Qwkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RWTVHKYOfdYsPf+q79AT6inzHJlFcuwDkIDiqFrGdFs=; b=Dhkj07X7SdOMpARBHT+nVEOX1prJolJihQMfRprMZn3KycqO7BFlivpw/Cx6x4soyo IqkaP2ResDqxMUAmCCMzvN6CkvQXOM3GLL5s1w5WWV5Rljz7auIFPGTVrb6NX3P3XNjy B2PiAaqGK8IPQ8T9I+YBO4r7e5MfXhTKytVBuit8Io473ceMKAu6j9g8gjKt8BU6gZEt M03vYUAyrbNdkySha4juBw7LRwC58JRRnGFASEAxCacZgBCwY/b8OCfRlhUMsnDQavx+ 0HHpkrh5+mRNZaayP1/rTcfz5hyBMBXyijXKiZ8Oq/F1/O9yzf6VsoOuQe9NON7uS2cm Y6Jg== X-Gm-Message-State: APjAAAUIB6q8d/oSqkQ7nV4hF8vFvN9gLorlSJ1FWOiXxt4MKDLjqais 0SwPfc/xuvFCOvKSrw1nKG6Hpw== X-Google-Smtp-Source: APXvYqwcYTvviQMYx55fP2yt2Aa2mwV+1Zq5tkQrsNeRH3nh4aL8oEs5LN6ve9DgyA9rB3h1N60p9w== X-Received: by 2002:a1c:98cf:: with SMTP id a198mr8814086wme.51.1558544458080; Wed, 22 May 2019 10:00:58 -0700 (PDT) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id d198sm6127704wmd.1.2019.05.22.10.00.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 22 May 2019 10:00:53 -0700 (PDT) Date: Wed, 22 May 2019 19:00:51 +0200 From: Tomas Vondra To: Mariel Cherkassky Cc: pgsql-performance@lists.postgresql.org, pgsql-admin@lists.postgresql.org Subject: Re: pg_restore takes more time on creation of rules Message-ID: <20190522170051.nqsjbl26qsdct66j@development> References: <20190522154102.zpvieebklnvis5u3@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-1444-295967-dirty List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, May 22, 2019 at 06:44:29PM +0300, Mariel Cherkassky wrote: >By rules I mean DB rules (simillar to triggers but different) > I very much doubt such high number of rules was expected during the design (especially if it's on a single table), so perhaps there's an O(N^2) piece of code somewhere. I suggest you do a bit of profiling, for example using perf [1], which would show where the time is spent. [1] https://wiki.postgresql.org/wiki/Profiling_with_perf And please stop top-posting, it makes it much harder to follow the discussion. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services