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 1lShwV-0008Oi-22 for pgsql-performance@arkaria.postgresql.org; Sat, 03 Apr 2021 15:12:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lShwT-00051L-T2 for pgsql-performance@arkaria.postgresql.org; Sat, 03 Apr 2021 15:12:05 +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 1lShwT-00051E-Lj for pgsql-performance@lists.postgresql.org; Sat, 03 Apr 2021 15:12:05 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lShwR-0005GW-T9 for pgsql-performance@lists.postgresql.org; Sat, 03 Apr 2021 15:12:05 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lShwP-0001ij-TF; Sat, 03 Apr 2021 11:12:01 -0400 Date: Sat, 3 Apr 2021 11:12:01 -0400 From: Bruce Momjian To: aditya desai Cc: Justin Pryzby , Pgsql Performance Subject: Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration. Message-ID: <20210403151201.GD29125@momjian.us> References: <20210403141651.GI6592@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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: Archived-At: Precedence: bulk On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > Hi Justin, > Yes, force_parallel_mode is on. Should we set it off? Yes. I bet someone set it without reading our docs: https://www.postgresql.org/docs/13/runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER --> Allows the use of parallel queries for testing purposes even in cases --> where no performance benefit is expected. We might need to clarify this sentence to be clearer it is _only_ for testing. Also, I suggest you review _all_ changes that have been made to the server since I am worried other unwise changes might also have been made. --------------------------------------------------------------------------- > > Regards, > Aditya. > > On Sat, Apr 3, 2021 at 7:46 PM Justin Pryzby wrote: > > On Sat, Apr 03, 2021 at 04:08:01PM +0200, Pavel Stehule wrote: > > so 3. 4. 2021 v 15:38 odesílatel aditya desai > napsal: > > > "Gather (cost=1000.43..1002.75 rows=1 width=127) (actual > > > time=174.318..198.539 rows=1 loops=1)" > > > " Workers Planned: 1" > > > " Workers Launched: 1" > > > " Single Copy: true" > > > " -> Index Scan using address1_i7 on address1 dom (cost=0.43..2.65 rows > =1 > > > width=127) (actual time=0.125..0.125 rows=1 loops=1)" > > > " Index Cond: (address_key = 6113763)" > > > "Planning Time: 0.221 ms" > > > "Execution Time: 198.601 ms" > > > > You should have broken configuration - there is not any reason to start > > parallelism -  probably some option in postgresql.conf has very bad > value. > > Second - it's crazy to see 200 ms just on interprocess communication - > > maybe your CPU is overutilized. > > It seems like force_parallel_mode is set, which is for debugging and not > for > "forcing things to go faster".  Maybe we should rename the parameter, like > parallel_mode_testing=on. > > http://rhaas.blogspot.com/2018/06/using-forceparallelmode-correctly.html > > -- > Justin > -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.