Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIMSP-00078b-1N for pgsql-bugs@arkaria.postgresql.org; Thu, 01 Nov 2018 23:32:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIMSL-0002S5-MJ for pgsql-bugs@arkaria.postgresql.org; Thu, 01 Nov 2018 23:32:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIMSL-0002OF-Au for pgsql-bugs@lists.postgresql.org; Thu, 01 Nov 2018 23:32:53 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIMSH-0003S6-Qe for pgsql-bugs@lists.postgresql.org; Thu, 01 Nov 2018 23:32:51 +0000 Received: from [192.168.127.1] (port=17362 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1gIMSC-000Hoe-B2; Thu, 01 Nov 2018 23:32:44 +0000 Received: from [127.0.0.1] (port=45046 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1gIMSB-000DCB-Lg; Thu, 01 Nov 2018 23:32:43 +0000 From: Andrew Gierth To: Paul Schaap Cc: Jeff Janes , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15475: Views over CITEXT columns return no data In-Reply-To: (Paul Schaap's message of "Fri, 2 Nov 2018 10:26:57 +1100") Message-ID: <87k1lw4bqz.fsf@news-spur.riddles.org.uk> References: <15475-11a7a783fed72a36@postgresql.org> <40F193E8-0927-4B6A-96E0-7EC5603DC19A@ipggroup.com> <19F765FE-34CC-4081-BFED-DFA2D38BF3BD@ipggroup.com> <87zhus4xg5.fsf@news-spur.riddles.org.uk> <21207C8F-9952-4AD7-B8A1-97B490725011@ipggroup.com> <87o9b84es2.fsf@news-spur.riddles.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Thu, 01 Nov 2018 23:32:43 +0000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Paul" == Paul Schaap writes: Paul> Hi Andrew, Paul> I agree it seems implausible to me too however it is 100% Paul> reproducible, see below track of it happening, I have changed the Paul> names of things to protect the innocent ;-) : Can you show the result of adding EXPLAIN ANALYZE in front of your select queries, both in the failing and successful cases? i.e. $ psql -c "EXPLAIN ANALYZE SELECT COUNT(*) FROM my_events WHERE my_date >= '2018-08-01' AND my_date < '2018-09-01' AND type_id NOT IN ('A','LIST','OF','NOTS');" my_databasename (and likewise for the other queries you showed) -- Andrew (irc:RhodiumToad)