Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDG89-0005mG-Vz for pgsql-committers@arkaria.postgresql.org; Wed, 15 Jun 2016 19:05:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bDG89-0001l7-DS for pgsql-committers@arkaria.postgresql.org; Wed, 15 Jun 2016 19:05:37 +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 1bDG88-0001kq-Kl; Wed, 15 Jun 2016 19:05:36 +0000 Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bDG85-0003cH-M5; Wed, 15 Jun 2016 19:05:35 +0000 Received: by mail-ob0-x22e.google.com with SMTP id wj2so888079obc.0; Wed, 15 Jun 2016 12:05:33 -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=4FVQF4826hkKLHUlafaP2d58WjUf81xDfqBxBbn2Q98=; b=boxhP19ep7gJXhoxrn6zuyHxbVbP+SqYt7956OH/AH7wQVy/8vSHlYM1ki9TqVX0q8 LIjX+FeR8vg35yNMIN4MxtuZ2Jh3TS1Vj71r4FINQC97MBAnrwTW70RVdaoIGXEPEm70 I0alTSEQuuZgMt7N/5PHsX+T5RchPx/zW/Tkr3Xmv126QIFp4+5I/FoIvSMMnqo2FSna Uv0JpiM314n1rOLJBkEd5q6qs88riQqyRR+pc6n1Hbaxw77dc44d3Mh9d/39GHksoIhe tYofkf/Lv6QOY3sXtc0sHV/NiKj06yRDOSSC2vXn8HQZ/kvJFMRxDP+lhO2F8pxk/2iZ 6xyg== 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=4FVQF4826hkKLHUlafaP2d58WjUf81xDfqBxBbn2Q98=; b=b2wFI6F2yRA5Z6/eyVugTvqnNg4ElhzNqaZ4WfyXkHswOax8VejkfI/K0ecWFsy95z OvRViqhOLAWcoMdlqC2F5gGqi2kCVJ0IG+1GZhij2b25OB9ijXF8lr61JUbJUrkjzA3Q jF9Hj4JVRFeKzqMAfy+jl/Ch7WFOhmfm/+IWeglZWXJvAdXE1ZrurEG8PXfFeguOUyJi HZJMGnbWYukFvDcijDILPPKHPLyMOnSKrwa1qUiXY9WIPR+V1ByRiDyB0ky+t5EDz+e8 wjVc0UJvYGKtAp2cTXMhXDqWRUdLIQKeV05w0Eqj0pGW1Atq2iFcG/xtEis+YWl+daaM 5RFw== X-Gm-Message-State: ALyK8tLkYBMAlU2ca8esQnrXkc5APXPy/CfFo0K7NFAdnfV6EipCA4i82iIAb+++uhmXCxo5zwo/43SE4QHUBQ== X-Received: by 10.157.17.113 with SMTP id p46mr151912otp.137.1466017532757; Wed, 15 Jun 2016 12:05:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.168.105 with HTTP; Wed, 15 Jun 2016 12:05:31 -0700 (PDT) In-Reply-To: <20160615185950.GA21739@alvherre.pgsql> References: <20160615185950.GA21739@alvherre.pgsql> From: Kevin Grittner Date: Wed, 15 Jun 2016 14:05:31 -0500 Message-ID: Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < To: Alvaro Herrera Cc: Robert Haas , Andres Freund , Ants Aasma , Amit Kapila , Noah Misch , Kevin Grittner , "pgsql-hackers@postgresql.org" , "pgsql-committers@postgresql.org" 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-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On Wed, Jun 15, 2016 at 1:59 PM, Alvaro Herrera wrote: > Kevin Grittner wrote: >> On Wed, Jun 15, 2016 at 1:50 PM, Robert Haas wrote: >> >>> The expression index case is the one to worry about; if there is a >>> problem, that's where it is. What bothers me is that a function used >>> in an expression index could do anything at all - it can read any >>> table in the database. >> >> It *can*, but then you are lying to the database when you call it >> IMMUTABLE. Such an index can easily become corrupted through >> normal DML. Without DML the ANALYZE has no problem. So you seem >> to be concerned that if someone is lying to the database engine to >> force it accept a function as IMMUTABLE when it actually isn't, and >> then updating the referenced rows (which is very likely to render >> the index corrupted), that statistics might also become stale. > > We actually go quite some lengths to support this case, even when it's > the opinion of many that we shouldn't. For example VACUUM doesn't try > to find index entries using the values in each deleted tuple; instead we > remember the TIDs and then scan the indexes (possibly many times) to > find entries that match those TIDs -- which is much slower. Yet we do > it this way to protect the case that somebody is doing the > not-really-IMMUTABLE function. > > In other words, I don't think we consider the position you argued as > acceptable. What are you saying is unacceptable, and what behavior would be acceptable instead? -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers