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 1lc0N2-0004vp-Iv for pgsql-general@arkaria.postgresql.org; Thu, 29 Apr 2021 06:41:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lc0N1-0001ci-He for pgsql-general@arkaria.postgresql.org; Thu, 29 Apr 2021 06:41:55 +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 1lc0N1-0001bN-AF for pgsql-general@lists.postgresql.org; Thu, 29 Apr 2021 06:41:55 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lc0My-0004br-Vt for pgsql-general@lists.postgresql.org; Thu, 29 Apr 2021 06:41:54 +0000 Received: by mail-wr1-x42e.google.com with SMTP id d11so7721548wrw.8 for ; Wed, 28 Apr 2021 23:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=mi382rhLn36PrylvSH34tIOjmbwrtnTRN4PAtvCbQR4=; b=RePYwHpzGzbViqtqFnUUc3wUZ0+Tw1yVnkOPhS/rBV5jRasm8oaR/n6CB4ndYG8l3Y I5N6+DxHW5sIJ6ZjhfVTyyVYDAVCcj1XW0lUUEeKO8zl3X4VJPJrjUr2dMgNv0VzlUPR cbU4kuW/1jj5FGopYvE4n+xOhS8qunGVZvaBhlaO6vuvOrPa6xVgVz3/Mgb+651HPc9m rK6EqGcjaPu+5J4iNdIx7LoaQxCcfukHEEPUG84MXeq9hRJY8mgxcb2ZFuCYPWs634r+ ieUz5skWaUaKuvESgVhlmb8nP/iBPenJq2ur+mmjUL4ltJJVPtogw+6kipAmo3s2blF4 bPGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=mi382rhLn36PrylvSH34tIOjmbwrtnTRN4PAtvCbQR4=; b=h7xO98lddP6zHdvtQxM31grTqVmCt5gEpWZtAR+KrM2fMkmEDFTfRK3mA/yGSPpvS+ 7yCtN1JmGSnXQBGW/MJ8jw6c/N6A7tMOIblDddyHiSbgUDirfJ0QELAqvszvToKyMDTT fCPWE109PaxeZkg9DUrBG7Xy0TPHrtGluI1BdHXQHkJtwKnX6UxI15/4CZOo2bdUv/hS zRWruk+Dc8EUh+SvdJXvGW5+Os+lWS90p25UD0AD7vo2lrMblbrjs8vNsCQbhBd+YHTY rnJdzwsDAcZvvt/00ix9z/6CGDLCAlw3rWvaN1L0ATL6QDcJbXOZwUj3rs5UGOFtEH4x SERA== X-Gm-Message-State: AOAM530zclf959TTh0x7tRmKgrQ/w9005xedblKecMMv2QkluIMp3ezx 3t9YWKj98S9Wq9v1nenB04x4Kg== X-Google-Smtp-Source: ABdhPJypxIGIwm31jd1LcSnQOpx/Dno0iy7xkmmGnq+AUW2xAdMcnIkdIk92cys+lE9jig3Zz6mZBQ== X-Received: by 2002:a5d:4452:: with SMTP id x18mr22593352wrr.286.1619678512169; Wed, 28 Apr 2021 23:41:52 -0700 (PDT) Received: from localhost.localdomain (217-149-168-244.nat.highway.telekom.at. [217.149.168.244]) by smtp.gmail.com with ESMTPSA id f4sm3312453wrz.33.2021.04.28.23.41.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 23:41:51 -0700 (PDT) Message-ID: Subject: Re: postgres index usage count too high From: Laurenz Albe To: Ayub M , PostgreSQL General Date: Thu, 29 Apr 2021 08:41:51 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2021-04-28 at 18:41 -0400, Ayub M wrote: > There is a table in the db, whose index_scan count from pg_stat_all_tables for this > table seems to be too high, there are not that many queries being executed against > this table. Wondering how this count can be too high. The table contains cumulative statistics. So you should remember the value, look again in a day or a week and calculate the difference to see how often index scans have been used in that time. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com