Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WephO-0002Fr-2J for pgsql-performance@arkaria.postgresql.org; Mon, 28 Apr 2014 17:50:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WephN-0000F8-D4 for pgsql-performance@arkaria.postgresql.org; Mon, 28 Apr 2014 17:50:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WephM-0000F2-LA for pgsql-performance@postgresql.org; Mon, 28 Apr 2014 17:50:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WephK-0000Lb-GL for pgsql-performance@postgresql.org; Mon, 28 Apr 2014 17:50:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s3SHoKmv023167; Mon, 28 Apr 2014 13:50:20 -0400 From: Tom Lane To: Michael van Rooyen cc: pgsql-performance@postgresql.org Subject: Re: Slow queries on 9.3.1 despite use of index In-reply-to: <535E8BFF.1010503@loot.co.za> References: <535E8BFF.1010503@loot.co.za> Comments: In-reply-to Michael van Rooyen message dated "Mon, 28 Apr 2014 19:12:31 +0200" Date: Mon, 28 Apr 2014 13:50:20 -0400 Message-ID: <23166.1398707420@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 Michael van Rooyen writes: > I'm trying to get to the bottom of a performance issue on a server > running PostgreSQL 9.3.1 on Centos 5. Hm ... it seems pretty suspicious that all of these examples take just about exactly 1 second longer than you might expect. I'm wondering if there is something sitting on an exclusive table lock somewhere, and releasing it after 1 second. In particular, this looks quite a bit like the old behavior of autovacuum when it was trying to truncate empty pages off the end of a relation --- it would hold off other accesses to the table until deadlock_timeout elapsed, whereupon it'd get kicked off the exclusive lock (and have to retry the truncation next time). Are you *sure* this server is running 9.3.1, and not something pre-9.3? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance