Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fTOtO-0002Ny-G3 for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jun 2018 09:50:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fTOtM-0008Ry-W0 for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jun 2018 09:50:08 +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.89) (envelope-from ) id 1fTOtM-0008Ri-HV for pgsql-hackers@lists.postgresql.org; Thu, 14 Jun 2018 09:50:08 +0000 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fTOtE-0004Uj-1l for pgsql-hackers@lists.postgresql.org; Thu, 14 Jun 2018 09:50:07 +0000 Received: by mail-it0-x241.google.com with SMTP id y127-v6so1919610itd.1 for ; Thu, 14 Jun 2018 02:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gTLRrMIB86IzHWWPtv9Xy3fzKitaby1vqr4zqXyoi+k=; b=OmTSbCZVozVxge8XklxzcCcMQphufeDyOBkap0DMOcerl0G1Hllcvvcj8xAEp9Njis 3T83klqmV0bbrfkoBQREVzivFzJUV7sL/NNbYHXraWG37cfsqY6ki4v/SUNrB/yMH6J/ /Zx26tMDS/Q9CytA5EagObnHQ0l0nWxKRcrdxm3RAW/MKWJtqUDCQ2ahJZzO26jRjIKM B63WD2oGzzNAci9UgkwnR+68Jbkeg3QsxxRjoNLn4p61y65HdJJFA3DQhxnVe/b2sEax mt2h0YD/+3qXk7Iwf3xpNBoVv/BfSEgFCqfW3oS7NLdnFo5M/EfxaVicSMqpOgZSew0I ceRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gTLRrMIB86IzHWWPtv9Xy3fzKitaby1vqr4zqXyoi+k=; b=PgkKESkc7QuY/Il8xR4y/bDZA0xpz2tYHlzNUcnO9CgK3B106ZlZhb5N+FjKMx0Mvo hFg7BsiaRdAGIMurt8pPM5JX+e+3JroX9ERZcEkIVbOfiss0dyZ0g6mYkLghjOMNVar/ RQuZNJq4KMrYPMbhyLyclv9PXnTuFfXJZF4BV+KxQH1remqbcfMG5Hm9MNo6/kd8QfhT hifv1TxF4P70W4RZfvIM/hh4Ax0AAVrQoB2rjNz2KRlsYr+2/cpNPqbyQAYvVICCVTnF AV4tzyE/UNJTvLenyfzJpcuPY9YQlXPWFENbMRCKeNMWnDPbqCyB7eexQTcMCabgYDIY 69TA== X-Gm-Message-State: APt69E2aSkUgjI4zCSKxdzIDMUTNCVgvGtk8k11deuEGxT/TqQnhbo4H eECaQs0V5wRLkP9kPOhuSVn2LucDCBHC0DqqrWs2Rw== X-Google-Smtp-Source: ADUXVKJlrLfBXmkC3bNwRA1vq5FWR9TobP9IbYCkBkyEDsllhEsNmZMMXOQ/qL4WTykvO6c1e4t4J0CM16thjoeFizw= X-Received: by 2002:a24:5a11:: with SMTP id v17-v6mr1670950ita.40.1528969798869; Thu, 14 Jun 2018 02:49:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:241f:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 02:49:58 -0700 (PDT) In-Reply-To: <7160.1528906240@sss.pgh.pa.us> References: <7142.1527868419@sss.pgh.pa.us> <1111.1527977170@sss.pgh.pa.us> <10432.1528045900@sss.pgh.pa.us> <569483c5-a273-6537-1b5d-7a271ce439fb@lab.ntt.co.jp> <22805.1528386192@sss.pgh.pa.us> <21787.1528428171@sss.pgh.pa.us> <17850.1528755844@sss.pgh.pa.us> <19365.1528820758@sss.pgh.pa.us> <30981.1528822481@sss.pgh.pa.us> <637.1528863347@sss.pgh.pa.us> <7160.1528906240@sss.pgh.pa.us> From: David Rowley Date: Thu, 14 Jun 2018 21:49:58 +1200 Message-ID: Subject: Re: why partition pruning doesn't work? To: Tom Lane Cc: Robert Haas , Amit Langote , Dmitry Dolgov <9erthalion6@gmail.com>, Jeff Janes , Ashutosh Bapat , Pavel Stehule , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 14 June 2018 at 04:10, Tom Lane wrote: > There's still one thing I'm a bit confused about here. I noticed that > we weren't actually using the partopfamily and partopcintype fields in > PartitionPruneContext, so I removed them. But that still leaves both > partsupfunc and partcollation as pointers into the relcache that were > subject to this hazard. My testing agrees with lousyjack's results > that both of those were, in fact, being improperly accessed. The OID > comparison effect I mentioned upthread explains why the buildfarm's > cache-clobbering members failed to notice any problem with garbage > partsupfunc data ... but why did we not see any complaints about invalid > collation OIDs? Tis strange. FWIW It's not working for me before e23bae82cf3 with CLOBBER_FREED_MEMORY, CLOBBER_CACHE_ALWAYS and RELCACHE_FORCE_RELEASE, and: create table listp (a text) partition by list(a); create table listp1 partition of listp for values in ('1'); select * from listp where a = (select '1'); I get: ERROR: cache lookup failed for collation 2139062143 -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services