Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avrHw-0002R2-A7 for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Apr 2016 19:07:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1avrHv-0000zV-T4 for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Apr 2016 19:07:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1avrHI-0007yN-1L for pgsql-bugs@postgresql.org; Thu, 28 Apr 2016 19:07:08 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1avrHD-0000LJ-Qi for pgsql-bugs@postgresql.org; Thu, 28 Apr 2016 19:07:07 +0000 Received: by mail-wm0-x229.google.com with SMTP id a17so1404917wme.0 for ; Thu, 28 Apr 2016 12:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=6WZZUjLiYy2mH0ZVQuKG1YF2IdbFO5HlNMkIqG2NM8U=; b=zltPPkzdBaLD8KbmwL0Pf4KoSRlzcydzFLLpZoOuSjMmEmKbhSKC6V3TYCQtOfV+1Y ryB/VKqiABfL6BrujV8gbW16RtlxkcQ7X4PAPr5yNHT6seZ+nng3HoZXxHCFmT49Iat1 Mo1ZmUfuwY8fbSRkwDknJYLdC/88xCPHUB0aw/X3q0SG4C1pyQRDLgJ+B97dyKYR+1H+ J16tzVfBM/DT5XE3d9B9TKf8XuZECNJ8ZMlD/N74OiG/hGjp8TK2hmMeA3XZzggZpmjC vluCXAjozDQtotDidQySZrQHaJqcHCTXli8riyfZALnl1S1lykxjRVN5yhu5dTQsb0Nw P/Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6WZZUjLiYy2mH0ZVQuKG1YF2IdbFO5HlNMkIqG2NM8U=; b=Vyqy9bIRSgtdLwRHL0G3fLefchTkibN5E2j9ILTzCx4+pkMUR27VMjk9o/m2IoXj+z +VM/oYXd0prx2vkmBXBJoSr4LYGKVmpxK/IcK9cI/O9wkuiKhQagC3wW/ByisyEG7jQq hi/ltN5yKj44+HR9+zccbhANOnzWLW8Wlz6tFTODhI8JZhFTHgBOwDLprlP7gU8A2jRW P6NKWAdCYWNY7qQwsTYV4UGVfPvLEHpBRAQaw97e5466qoEna+gUVSSjufk3fh95V5bW 0llCJelccqnx55V+bnBiDfFg5y4yO0r+EzL48/OGvWdMz9moMDbjECTUuSJ6H3GEg9qT 6I1A== X-Gm-Message-State: AOPr4FUwBR+woJuCwswdyK3H/5oUBHZaLvbNRKQJO7UJKs7M8CoA6B7h6Hoi4pk15YcDtA== X-Received: by 10.194.104.202 with SMTP id gg10mr18558614wjb.103.1461870421889; Thu, 28 Apr 2016 12:07:01 -0700 (PDT) Received: from [192.168.1.144] (dsl-25-149.utaonline.at. [81.189.25.149]) by smtp.googlemail.com with ESMTPSA id u12sm15404590wmu.12.2016.04.28.12.07.00 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2016 12:07:00 -0700 (PDT) Subject: Re: BUG #14107: Major query planner bug regarding subqueries and indices To: pgsql-bugs@postgresql.org References: <20160421115638.22895.78902@wrigleys.postgresql.org> <69e376c7-6c2c-c96d-2ad6-3734affb59b7@gmail.com> <44df2e58-87f5-282c-9871-c735240c55e4@gmail.com> <1461406942121-5900147.post@n5.nabble.com> <3ac6f379-08f8-d1db-639f-2dc3075d2eb4@gmail.com> <1461610493986-5900430.post@n5.nabble.com> From: Mathias Kunter Message-ID: <629ecf23-b7b2-2d73-6792-150b111e83ab@gmail.com> Date: Thu, 28 Apr 2016 21:07:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1461610493986-5900430.post@n5.nabble.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org > Seems like it. I've asked folks on IRC for help, and it was confirmed the > bug exists since 8.2 So, as it currently stands, queries of the following synopsis are de facto unusable with PostgreSQL, as these will always ignore any existing indices and trigger a full table scan instead: SELECT ... FROM a WHERE a.x = ? OR a.y IN (...); SELECT ... FROM a JOIN b ON (...) WHERE a.x = ? OR b.y = ?; The following SQL fiddle demonstrates the bug: http://sqlfiddle.com/#!15/ab714/2 Does anybody care? Shouldn't something like this be fixed ASAP?? -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs