Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mE1eh-00005q-Sw for pgsql-performance@arkaria.postgresql.org; Thu, 12 Aug 2021 03:45:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mE1eg-0008AO-Sw for pgsql-performance@arkaria.postgresql.org; Thu, 12 Aug 2021 03:45:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mE1eg-0008AG-Gh for pgsql-performance@lists.postgresql.org; Thu, 12 Aug 2021 03:45:18 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mE1ed-0005Ar-HU for pgsql-performance@lists.postgresql.org; Thu, 12 Aug 2021 03:45:17 +0000 Received: by mail-io1-xd30.google.com with SMTP id f11so6507279ioj.3 for ; Wed, 11 Aug 2021 20:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yCqAWbCfGOdHbBzNZegF0XGqM0Stxj7jSlGvBFPLy0E=; b=WmW3e2TGIsaVzWC2HKnp64uidvzunu31osDhwApeg78XaZX/ina4p0gBGBteuBFUEv IJ22oZV/nyTQA25Xg0cqHt31FIoZLRm2pzx4xSerTfWZqdK4DTppH61ZPf1Honl/vaZ1 qmx4ogbP/4gZQg0wp8DXtBLYK4tw7gE+rok0ezymlWGV2KfLkhgfpaYYX+IXq8utnzjK yam1YeAc0dxTNcXKq8XkPaDgpD2mhQ4kwQlsydcur2qH+WwJVYA2YgU4BqLeWI4yW3yG igNuVxvqxwkKuzj12QAstvURvQZeIdVhgbq3qMefzlEMDSoR9XZutEfGA0lJEbS5+AsI VK4Q== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yCqAWbCfGOdHbBzNZegF0XGqM0Stxj7jSlGvBFPLy0E=; b=DgslqJX/bz8kAmhm0zJW3TlEv+mcoYS5gxaSvkV8IM+SujYvWXVPCb3cWkuJqkXCMN 64KpCIYrIev13+NyWxtSXltf0T8L9iPfakRZhxYheXQ8C3vmEWhnwDJqZbTH/PrHF96Q GbgA4fu634RmasYbAzwMMIasn+T2OEtlaLL7XLBzEclHbMkoCWGP6sZoO+ihSu18NQM2 AOCmPlnZ0Y8MjnyMUo9c6LJIpJUFbyXB2dvqROJFxcm4fdNOgbwD2irHJNpNsSco9T+X 0xBc194BAzf6ng6ITiqH3Kf/CLLxbkCuWkpdr+HZ0JovtJMQLr+AwMJD44/qhXc22npv YiIQ== X-Gm-Message-State: AOAM530PtA1Q4Z2DkH53vll7RadSGapQvc6EC6L6xYOKeFmjrzpcZxqW oRljAKe+s0/P8BHozPHmVvxpYUcE7Mo4DQ== X-Google-Smtp-Source: ABdhPJxRkHrx0FQA0+/WKKquQrkZa69HSqHJXvUREsG1CWKRD07NaQGzkRUL76wYQ22zl6cSo6WR3g== X-Received: by 2002:a6b:b241:: with SMTP id b62mr1473762iof.80.1628739913663; Wed, 11 Aug 2021 20:45:13 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o10sm793440ilu.34.2021.08.11.20.45.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Aug 2021 20:45:12 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 33A7A800B35; Wed, 11 Aug 2021 22:45:11 -0500 (CDT) Date: Wed, 11 Aug 2021 22:45:11 -0500 From: Justin Pryzby To: Matt Dupree Cc: pgsql-performance@lists.postgresql.org Subject: Re: Postgres using the wrong index index Message-ID: <20210812034510.GG10479@telsasoft.com> References: <20210811123856.GE10479@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The rowcount estimate for the time column is bad for all these plans - do you know why ? You're using inheritence - have you analyzed the parent tables recently ? | Index Scan using other_events_1004175222_pim_evdef_67951aef14bc_idx on public.other_events_1004175222 (cost=0.28..1,648,877.92 rows=1,858,891 width=32) (actual time=1.008..15.245 rows=23 loops=1) | Index Cond: ((other_events_1004175222."time" >= '1624777200000'::bigint) AND (other_events_1004175222."time" <= '1627369200000'::bigint)) -- Justin