Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huiL0-0006zn-Bq for pgsql-general@arkaria.postgresql.org; Mon, 05 Aug 2019 19:08:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1huiKz-0003bU-6H for pgsql-general@arkaria.postgresql.org; Mon, 05 Aug 2019 19:08:05 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1huiKy-0003MP-KW for pgsql-general@lists.postgresql.org; Mon, 05 Aug 2019 19:08:04 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huiKv-00019i-Mu for pgsql-general@postgresql.org; Mon, 05 Aug 2019 19:08:04 +0000 Received: by mail-qt1-x844.google.com with SMTP id w17so1425573qto.10 for ; Mon, 05 Aug 2019 12:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=cBacWIiB/gFTTWlaDYtuntz2ink/WTG3q9IDayr71ss=; b=DpXzUA4oa5stfV3TyFErfFRjo31/pBW30C+i3Mr6xA5WriUXYH4pvN7cTFi12Oyzon s5Zl6MedpPCZEm/C68mGldtqxeHQKuCUZPSajWle/DmdepEaBM6qHFj1OdrDSh0idw5q llfs4zaYWJsPkjM0+G6ALwaY/wlr2Uboidyc8QUhTOMSR01miHb66kozIRRl+M9gqv+k r7nLek6+5OZ2t3XD2kOx0AoQMzAcmbf0yIrZiND42ga3fiaOPMVKBVL9Grik2PnrvdTe 4y+GaAHYNahTF+Ru/VLAbgi/hLQE+h5ZKEMbhqfv37yaQNxcVGz5f/j3wKDo+9ghXy8x 1Qsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cBacWIiB/gFTTWlaDYtuntz2ink/WTG3q9IDayr71ss=; b=aDtUxtQ4nK8SsZVfa4bOtN4Qk2emhZfHyqJuBwGnDpJlf4XoNzKkC4u4LvMwtwZhoA VKcXC4D73u6J2UkhCfP+dhqpVxZnUd0Aatvr2IFYc7PHyq1oeNzvkpmDBd2/WzDDBj0r gvZqJUynvrrSg4+pbI5MhT8QZqgHkbYJJKTgwmhkQLjjtqeGz6dayR7fYOfmPpN6yrwB IPnLqt6DlDm2dwDr6Ir1VY1C2knHLtZJ3PBM4DvmAWG4xHzyKPp8YPqzrxoP4EhHuzT1 ZHbiKsj9SnOxDNAywl0g0RlXg78s0c2j4V98C61iaqfk7eDoq5o6PJyvxryEViSVZRCr Pu3g== X-Gm-Message-State: APjAAAXq97Y3kn2PE9/RQP8mmqCADrTiKGGy+oijTml6EXdm+Q5OxI9g 3n17hNIdPzgXzUMMjyVVkmNUfw== X-Google-Smtp-Source: APXvYqyIL218sGLguN9mVDcXZ1jRbIeJhynt/KyMAzQxC3OmzPz7NXODay4bGRKpX+04Rium8H02RQ== X-Received: by 2002:ac8:1b30:: with SMTP id y45mr104561337qtj.218.1565032079873; Mon, 05 Aug 2019 12:07:59 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([201.186.81.5]) by smtp.gmail.com with ESMTPSA id r17sm38218192qtf.26.2019.08.05.12.07.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 12:07:57 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id B10FB12066D; Mon, 5 Aug 2019 13:27:17 -0400 (-04) Date: Mon, 5 Aug 2019 13:27:17 -0400 From: Alvaro Herrera To: Tom Lane Cc: Jeremy Finzel , Postgres General Subject: Re: Aggregate not using BRIN index on timestamp Message-ID: <20190805172717.GA10185@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2667.1565020427@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Aug-05, Tom Lane wrote: > FWIW, I suspect the hard part would be dealing with cases where the > extremal ranges (according to the index) contain no live tuples > (according to the query's snapshot). The btree case handles the > invisible-tuples problem by continuing a scan started at the index > endpoint until it finds a visible tuple --- which, in the worst case, > can take a long time. It's not obvious to me what you'd do with > BRIN. Hmm, yeah, that's a tough problem -- hadn't thought about that. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services