Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vmnUz-00GMKL-0H for pgsql-general@arkaria.postgresql.org; Mon, 02 Feb 2026 06:33:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vmnUx-00Bv9Y-0H for pgsql-general@arkaria.postgresql.org; Mon, 02 Feb 2026 06:33:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vmnUw-00Bv9P-1b for pgsql-general@lists.postgresql.org; Mon, 02 Feb 2026 06:33:23 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vmnUv-00000000958-1gRl for pgsql-general@lists.postgresql.org; Mon, 02 Feb 2026 06:33:22 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-b884cb1e717so765536366b.0 for ; Sun, 01 Feb 2026 22:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770014000; cv=none; d=google.com; s=arc-20240605; b=XaTnFDGF54Hqdw7tuleTr7BzraUH3ydsHap8T/g3gcB5WGddKwpVw8V8WfeOQmDqHg GSbyLkwnXN2kf0vTj1cRxhsHzf1IEd0M8yl7YxE7Z/Xirxbxkmkthqcwppu9wGh5JLCQ gHxuxwGKd4fzW3qFFzCGvRH61MwKS73pWsN8vtJVh1erLdExcaq+7JDu/40rdU2w/EEs 6FlMdPidTI983OU4Zgcl41MeQO0CjJKAvWFbpDatJICP9p7ORKGxU5Fx332zYcS09gq+ 0lA7LxT+vQ4BaP3F4lqknf1dKnOQv/Jg9nDKk5JxSasVI1Y/TPA+WeQKCY5ag11mSGhD X2lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Ytt2NcVzwap+lc0pJkGVvbtTMDIqb/YmPASO1ZqMnFQ=; fh=xHNDpWvvxXEUGTKrJAqSZicRb5tX/OKNE5/kfNsbwVg=; b=atr19QgUSGFCI1b/xHHYRMfkMl/QQe5sZNbPJTbC+ibNA3Q9FKCsikWe1HJNG+H2L/ z6F9aibuO6lfcymUgcdvwV2Y+FbZtHSuwpluL1MYpsgs47mkA+XWMkUqAoRcwlsbLHlz rr8Tvuv8Hr+AZQ/m/Efn6P4XRTilQOXYb4JyM4uJ9/arZNOGaK8pFGPi0e5gw4izn8wr eywKyy4L+SXSqegFQgrOg9u9MC2NBhfN8Z7wDLDHa+f8mXICkSji+/GVGriAKAsCvQ0B 9qwEkIAuhUWZhQbJE+ClmAgk/8FgVOWGptQ230xMtY/qgRfle/ocpLBIt8MMpTQgyNi0 8pHA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770014000; x=1770618800; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=Ytt2NcVzwap+lc0pJkGVvbtTMDIqb/YmPASO1ZqMnFQ=; b=BlT8uEAoBlQTpzV1+pyPsA2Jt+kg46GEJHID0C58KbCx1ua0BV4CsNYabepv/NTspE DBXt0PAmW+0B1QJJryQy6pUFypzzywMJHF/r4k7UGOBx1W8PI/FAzzxSZEewZ1OwGXJv fjHRa1bfTbdrmCKRIBulnYa6CRJwusfIZSIsjcc3neL2VW3v3rqCzbYSwoaGTxZEei5a gaVlXxvz3jpZQWO4cQX6Emi0jPop2LusxX+7i+ADjAfdggi7x84dedCMB5X6fCQdFL0Z F+3TJaC0idBkq3vuRuNQdkGwEOjKiNYmEvnX/X/scCeIIvAOGL3MvdcrU/aNGx4jK+8c 31PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770014000; x=1770618800; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ytt2NcVzwap+lc0pJkGVvbtTMDIqb/YmPASO1ZqMnFQ=; b=rErAsOqiM/QqATzQCVLBa7//PFgpIdWVFv7dDTNpE5CKDVEufEY6GSlPiYmeayLOSs rqq4wgxUVqmcUnbZCbh8GnmIW1QkEsUxwzfjRLjKtk9MoOFfCHL39vJFkKHVwkTcfmd/ OcKmqaHGVTnISXaGF2YT5Nbxeg++N4XLQkBzXY7sbJUB2ht9kLeCGg+URZFhKlena/kM XO4uqSFJDTx/BgOzlybfEMwPbTfKAnSpar2pFSqbgvE7TDdIbt0RWA6WxBJSTljnoTKd V0lXO90Mmnja/W97HCjf5QobxHOaZ6yOy7+U/QPMDiBFpkpMm/ohzqH4wPUkW/WB64eV GSxQ== X-Forwarded-Encrypted: i=1; AJvYcCUK/aak9YkWZ+oZ5jcR3Emo7pg/mYsMe8i+fADBDRnDfuIGcaIZl6SvlFodPWAqdYNG7KDLOFKvxX5P3n2u@lists.postgresql.org X-Gm-Message-State: AOJu0YyhFMtNYTqyw3COxTbzThMEnxv+nT2IBKUekrTObNubn0Ugjnim i5EODd6dPfBWnuO2FPKzxbCOLqcO/HyfGjAhTdErKFYuc0ONUXrRQ5AxP9AFHxLIwpmfsoEUd1x wNWL2EZvfG+y/x3Hytqb0ikLqWNzGZ5g= X-Gm-Gg: AZuq6aKHpF7x37v1VvWqd6TgOmovbT0vMjRRnxWHzPMFhJxB8AbPdJ+9JnEarW+v8TJ Bpvrg0XO+ph2OAm6qpivrdADvg/OKcK1tg5eDwqfD1qa8KZl+h/bvG7gyA/h3kHC5UJjgVSQmDm UatW/6MLYR6KzIH4ncvS1oWmJw2U7AvhcqZpIoLQM1AI6giJiIwSMTEz6ErgBZMpi54KMIexyUO t8QkIOrSf5OqzXHpvg94ievcW1CdhjDM4zBPRHz8sXGCMFGP2WEvM14W+P6P1H8tzCsXaoqcL2E kmAjYDczUmX1 X-Received: by 2002:a17:907:849:b0:b73:37aa:87c0 with SMTP id a640c23a62f3a-b8ddf9b3919mr818579566b.23.1770013999607; Sun, 01 Feb 2026 22:33:19 -0800 (PST) MIME-Version: 1.0 References: <63F54040-608A-4ED4-A23C-E6767FF87088@gmail.com> In-Reply-To: <63F54040-608A-4ED4-A23C-E6767FF87088@gmail.com> From: yudhi s Date: Mon, 2 Feb 2026 12:03:08 +0530 X-Gm-Features: AZwV_Qg40oQEKwEiadsJ0jKOtbeOA8-WGyDM0qFwWwqPXX6Q7xvpzN__NjMN754 Message-ID: Subject: Re: Top -N Query performance issue and high CPU usage To: Rob Sargent , pgsql-general Content-Type: multipart/alternative; boundary="000000000000b1b3f50649d17f75" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b1b3f50649d17f75 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2 Feb, 2026, 11:21 am Rob Sargent, wrote: > > > Thank you so much. I need to get back on the exact number of such > queries which can hit the database. However, as 1000 of users will be > there, so the possibility of all logging into the system on the same page > at same time needs to be found out. Will double check on this. > > > > However, when you said caching :- The results on the base tables are > going to be ~30-50 million. This landing page has filters on it so it may > be of 30+ different > > I know I read OP=E2=80=99s earlier descriptions to suggest that each logi= n saw the > same data. I was wrong and I suspect the suggestion to cache goes out the > window. > > The need for more resources now comes centre stage, right beside query > tuning. You won=E2=80=99t get much help here on the latter problem withou= t more DDL > on the tables involved. Help on the hardware is just money - though most > desktops these days are more powerful than that vert described up-thread Won't , the materialized view having a minimum Delta refresh frequency(5-10 > minutes?) help in such scenarios? As the overhead of the query complexity > will lie within the materialized view and it can be indexed as per the > dynamic incoming filter conditions. --000000000000b1b3f50649d17f75 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, 2 Feb, 2026, 11:= 21 am Rob Sargent, <robjsargent= @gmail.com> wrote:

> Thank you so much. I need to get back on the exact number of such quer= ies which can hit the database. However, as 1000 of users will be there, so= the possibility of all logging into the system on the same page at same ti= me needs to be found out. Will double check on this.
>
> However,=C2=A0 when you said caching :- The results on the base tables= are going to be ~30-50 million. This landing page has filters on it so it = may be of 30+ different

I know I read OP=E2=80=99s earlier descriptions to suggest that each login = saw the same data. I was wrong and I suspect the suggestion to cache goes o= ut the window.

The need for more resources now comes centre stage, right beside query tuni= ng. You won=E2=80=99t get much help here on the latter problem without more= DDL on the tables involved. Help on the hardware is just money - though mo= st desktops these days are more powerful than that vert described up-thread=

Won'= t , the materialized view having a minimum Delta refresh frequency(5-10 min= utes?) help in such scenarios? As the overhead of the query complexity will= lie within the materialized view and it can be indexed as per the dynamic = incoming filter conditions.=C2=A0
--000000000000b1b3f50649d17f75--