Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQIe0-0006Mo-9Z for pgsql-performance@arkaria.postgresql.org; Thu, 21 Jul 2016 18:24:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bQIdy-0006O4-IU for pgsql-performance@arkaria.postgresql.org; Thu, 21 Jul 2016 18:24:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bQIdx-0006Nx-UO for pgsql-performance@postgresql.org; Thu, 21 Jul 2016 18:24:22 +0000 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bQIdu-0007uW-Pf for pgsql-performance@postgresql.org; Thu, 21 Jul 2016 18:24:20 +0000 Received: by mail-oi0-x233.google.com with SMTP id l72so130059121oig.2 for ; Thu, 21 Jul 2016 11:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VtHXcv9B8nw9HMQCnW1pQfpxffnz04+tVX935GuNSjw=; b=Dq5i5bMJMCM02ez8cz29XjnYEdqU6ff26wBAmYrN9LQaSJc2qV3Ytv/wvbjZvoiaaS te5WKG6fA0qLijPTESB3RIl00tMSx0tGr4nR/+phA6rbBdY04e7SeSnOmamJuc5oBcDp ZytImTnrh8vMrDgUVHAPiXhk6sbmeRTgQAHEo815zUQhnPMWAX8hhyT1Vo5rY1nGfTjz 4E1XWf5/6vAEdvK0jvm8Rssgo0CgMUfKY8mgKwPirKrtLZCkN8F8j+hF/uhwsqknR7em UM37LLx4QaFESwfPiSKBy/Uf8/uBX4WUkTH5FZ2WCsichfERFg0R+Yf/86ZXxKfXsjM+ y3TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VtHXcv9B8nw9HMQCnW1pQfpxffnz04+tVX935GuNSjw=; b=Zo9BBVOxpUYcVOvfNbcgOUWPKlqGdiE2oO3D3VMIL+CDkDgVYazrvc7EApbNHkGDVU p40GbB8huqkuvvW7KTUhm8mRpOtyVjJO5Jhibbai6duS8bdJpN/laJ2ZN5iNezh9TAvA GU2w5h+Tydzt9g8gKIqk/45T/kZbzhQUZzPRd2dn4yZ68Ntc1eUMbUx5enQoJD1N3iVb KPM3wbwKNep3uefYXxvb2YT2arfCJcxI4+QkK/BWNsyaB9LLiVOT3Snx+fwoTjXPNmbU 13xx+zIrf467vnRw1HF+B2Bz4nA4mBXNKOmUr/W5msKl+IK1+7tDewCbxRcoKSSTjmDr 3m7w== X-Gm-Message-State: ALyK8tLZRlsxiM0sgS2xmdAeCBdNXwHHLcf45JW0uNBlshxPYpx/NJIovyFB4qP2WA52vq5bJ7rjgiEV5CXyQA== X-Received: by 10.202.243.193 with SMTP id r184mr25635888oih.137.1469125457668; Thu, 21 Jul 2016 11:24:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.77.149 with HTTP; Thu, 21 Jul 2016 11:24:17 -0700 (PDT) In-Reply-To: <1469112481.11501.12.camel@kth.se> References: <1464351030.15267.14.camel@kth.se> <32524.1464356784@sss.pgh.pa.us> <1464593729.16712.2.camel@kth.se> <1464616618.19212.3.camel@kth.se> <1469112481.11501.12.camel@kth.se> From: Claudio Freire Date: Thu, 21 Jul 2016 15:24:17 -0300 Message-ID: Subject: Re: Performance problems with 9.2.15 To: Johan Fredriksson Cc: postgres performance list Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.7 (--) 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 On Thu, Jul 21, 2016 at 11:48 AM, Johan Fredriksson wrote: > EXPLAIN ANALYZE VERBOSE SELECT DISTINCT main.* FROM Users main CROSS > JOIN ACL ACL_3 JOIN Principals Principals_1 ON ( Principals_1.id = > main.id ) JOIN CachedGroupMembers CachedGroupMembers_2 ON > ( CachedGroupMembers_2.MemberId = Principals_1.id ) JOIN > CachedGroupMembers CachedGroupMembers_4 ON > ( CachedGroupMembers_4.MemberId = Principals_1.id ) WHERE > ((ACL_3.ObjectType = 'RT::Queue' AND ACL_3.ObjectId = 85) OR > (ACL_3.ObjectType = 'RT::System' AND ACL_3.ObjectId = 1)) AND > (ACL_3.PrincipalId = CachedGroupMembers_4.GroupId) AND > (ACL_3.PrincipalType = 'Group') AND (ACL_3.RightName = 'OwnTicket') AND > (CachedGroupMembers_2.Disabled = '0') AND (CachedGroupMembers_2.GroupId > = '4') AND (CachedGroupMembers_4.Disabled = '0') AND > (Principals_1.Disabled = '0') AND (Principals_1.PrincipalType = 'User') > AND (Principals_1.id != '1') ORDER BY main.Name ASC; That cross join doesn't look right. It has no join condition. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance