Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XBQcc-0003ei-CY for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jul 2014 15:44:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XBQcb-0005U1-MJ for pgsql-performance@arkaria.postgresql.org; Sun, 27 Jul 2014 15:44:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XBQca-0005Tu-DH for pgsql-performance@postgresql.org; Sun, 27 Jul 2014 15:44:24 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XBQcS-0001PU-BW for pgsql-performance@postgresql.org; Sun, 27 Jul 2014 15:44:22 +0000 Received: by mail-pa0-f47.google.com with SMTP id kx10so8918496pab.20 for ; Sun, 27 Jul 2014 08:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=n+1EK7r5pa1bRhm3xwoAFDFPfmyKtYmpCMVELVClGn4=; b=kVtxjN5T1MLvoCWhAmTJW4UhAOnvtvPxZK5DhpKfxUl/1jN/r3+lTlSl0xmv+RciXA RWIqU1CjRQ6JOGPjVPNrO3dYQBi/y9C4LGu2YUZ9zseBt+cqe7tn3cEk2kYXvLKk0M8h 2/BDeCt92l2KBoRDmk+PtFLRdSPVhps7H5WBu/zk0f7s0LavnTNvXdWe3WB7TH2eWOcL 4jx5KbzWhxEmTij0xVjnjttpmMcSrP43/ia+mWY+m8/hQNL/p5SQUPKNlesNdKXONQlS /5eRAXpzV8XOA6b72wAjRtFUg3rMG3lImk1uHbuvMw4I9QYYx0nxGlM4VANAvvdbwjQi gmkQ== X-Received: by 10.70.103.132 with SMTP id fw4mr31894981pdb.99.1406475852222; Sun, 27 Jul 2014 08:44:12 -0700 (PDT) Received: from [192.168.11.4] ([180.164.153.84]) by mx.google.com with ESMTPSA id pp2sm20075555pdb.59.2014.07.27.08.44.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jul 2014 08:44:11 -0700 (PDT) From: Rural Hunter X-Google-Original-From: Rural Hunter Message-ID: <53D51E49.102@gmail.com> Date: Sun, 27 Jul 2014 23:44:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" Subject: Re: Very slow planning performance on partition table References: <53CFB6BC.4050606@gmail.com> <25010.1406253203@sss.pgh.pa.us> <53D26875.2080604@gmail.com> In-Reply-To: <53D26875.2080604@gmail.com> Content-Type: text/plain; charset=gb18030; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Anyone? I can see many pg processes are in BIND status with htop. Some of them could be hanging like 30 mins. I tried gdb on the same process many times and the trace shows same as my previous post. This happened after I partitioned my main tables to 60 children tables. And also, I'm experiecing a cpu peak around 30-60 mins every 1-2 days. During the peak, all my cpus(32 cores) are full utilized while there is no special load and the memory and io are fine. Sometimes I had to kill the db process and restart the db to escape the situation. I tried to upgrade to the latest 9.2.9 but it didn't help. ÔÚ 2014/7/25 22:23, Rural Hunter дµÀ: > I run dbg on the backend process and got this: > (gdb) bt > #0 0x00007fc4a1b6cdb7 in semop () from /lib/x86_64-linux-gnu/libc.so.6 > #1 0x00000000005f8703 in PGSemaphoreLock () > #2 0x0000000000636703 in LWLockAcquire () > #3 0x0000000000632eb3 in LockAcquireExtended () > #4 0x000000000062fdfb in LockRelationOid () > #5 0x0000000000474e55 in relation_open () > #6 0x000000000047b39b in index_open () > #7 0x00000000005f3c22 in get_relation_info () > #8 0x00000000005f6590 in build_simple_rel () > #9 0x00000000005f65db in build_simple_rel () > #10 0x00000000005de8c0 in add_base_rels_to_query () > #11 0x00000000005df352 in query_planner () > #12 0x00000000005e0d51 in grouping_planner () > #13 0x00000000005e2bbe in subquery_planner () > #14 0x00000000005e2ef9 in standard_planner () > #15 0x00000000006426e1 in pg_plan_query () > #16 0x000000000064279e in pg_plan_queries () > #17 0x00000000006f4b7a in BuildCachedPlan () > #18 0x00000000006f4e1e in GetCachedPlan () > #19 0x0000000000642259 in exec_bind_message () > #20 0x0000000000643561 in PostgresMain () > #21 0x000000000060347f in ServerLoop () > #22 0x0000000000604121 in PostmasterMain () > #23 0x00000000005a5ade in main () > > Does that indicate something? seems it's waiting for some lock. > -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance