Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XAgPi-0001Op-Ig for pgsql-performance@arkaria.postgresql.org; Fri, 25 Jul 2014 14:24:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XAgPh-0003A7-ND for pgsql-performance@arkaria.postgresql.org; Fri, 25 Jul 2014 14:24:01 +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 1XAgPg-00039w-Gv for pgsql-performance@postgresql.org; Fri, 25 Jul 2014 14:24:00 +0000 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XAgPc-00054F-2g for pgsql-performance@postgresql.org; Fri, 25 Jul 2014 14:23:59 +0000 Received: by mail-pd0-f169.google.com with SMTP id y10so5809846pdj.0 for ; Fri, 25 Jul 2014 07:23:52 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=aaqRDtcOv0/TABsGxGzQYOtZdP4W+4urTScTJ3yZERk=; b=Jf/11cMgk/EyU21cdsP+/2s2rfMJaDDiUC5F8qZTtFtLm7qWO6w8xfyNuvkhJ46REW xyghVdABimwbqDZqkKmaB9FllVDFi2P4n4FWrRSjicMZRvzKqlyJrTLvOmHcbGcW60V2 zlVYH6b6FBqR3G/VKD426iBiT1qf1ASzGo17f0euOu2TL4Ix9ZxWlQSSkus57c7YOi4y eBYzd5QJUpon352UdgOpMHi+vsGOBrvjiOhJ7msnZW5juELi0TJe9za/vsnJFrq1jTNp a69Q0FIhw7lnAABlWSFpWxqJN7K5Y3SIewD+lo5fsB/B7mThgxvabr/Y5WfJw79ndNgp W1kg== X-Received: by 10.70.133.167 with SMTP id pd7mr19295162pdb.31.1406298232884; Fri, 25 Jul 2014 07:23:52 -0700 (PDT) Received: from [192.168.11.4] ([180.164.153.84]) by mx.google.com with ESMTPSA id ey10sm11902890pdb.50.2014.07.25.07.23.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jul 2014 07:23:52 -0700 (PDT) From: Rural Hunter X-Google-Original-From: Rural Hunter Message-ID: <53D26875.2080604@gmail.com> Date: Fri, 25 Jul 2014 22:23:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Very slow planning performance on partition table References: <53CFB6BC.4050606@gmail.com> <25010.1406253203@sss.pgh.pa.us> In-Reply-To: <25010.1406253203@sss.pgh.pa.us> 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 ÔÚ 2014/7/25 9:53, Tom Lane дµÀ: > [ shrug... ] Insufficient data. When I try a simple test case based on > what you've told us, I get planning times of a couple of milliseconds. > I can think of contributing factors that would increase that, but not > by four orders of magnitude. So there's something very significant > that you've left out. Can you construct a self-contained test case > that's this slow? regards, tom lane 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