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 1vrxAP-00EeR9-1T for pgsql-general@arkaria.postgresql.org; Mon, 16 Feb 2026 11:53:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrx9N-0026DP-2Q for pgsql-general@arkaria.postgresql.org; Mon, 16 Feb 2026 11:52:25 +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 1vrx9N-0026DG-1I for pgsql-general@lists.postgresql.org; Mon, 16 Feb 2026 11:52:25 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vrx9K-00000000sph-3cBe for pgsql-general@lists.postgresql.org; Mon, 16 Feb 2026 11:52:24 +0000 Received: by mail-wm1-x341.google.com with SMTP id 5b1f17b1804b1-480706554beso29549805e9.1 for ; Mon, 16 Feb 2026 03:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1771242742; x=1771847542; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=EWQOz7Twc4r7RD79h+PLYBsjLQ3kMEwfOa/s41W4VAM=; b=sWfwL865xrSNiQHUUV5dUBNI/So1pH9rNocwHWUPqouTyQThv2/cL2BQrUA5Kiq6iu 9KukX4x21aFfawRCqRY+FlqEANZWj5Se0VXpsCO18HzVzpcqGS/CyAPwjK4EnaBGYTDJ PuQitlTF1BSze7cRbjoWYRqvt4+jhQ/iVzUjIgipyPwn+aYwvX36kMnVTL59Kta30TSJ pi8XKlrUZJ4gPKUI358vF8vXrnte+4wR8Drqxi7B6/Gd1DdbLp4KrUWCC4qt84M1y+GZ fCOrJ4NOdB9J146v9uWhpAvb7SqoGA/ybSihvFaNnBtUkR298JjybRsM5bux21e4eUJQ Bk/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771242742; x=1771847542; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EWQOz7Twc4r7RD79h+PLYBsjLQ3kMEwfOa/s41W4VAM=; b=D3hA1AWBtQbrKqOcBWFrR/MqswgNWbICxLBNGEZf3T6/jv3uizZtbcAUknMzj94hb2 bcb87/ulwnR1rkqQG/q/9V3qkZgNJqHF9VufMWQK1gtlEhXJGQKAd0ZXX/Y5fiTzAPwj Ro2GhJMuAINk7uYyjYkuaY4H4i3CgOqSRcMDxOow7eT1kP8Ip1J+vYZQYrDvl+2gMt/u kUQA5FuthH+oGwExWMvK6dhwFI1our2ejMT8H+gG0XkP/D2iIf9OcX7ELBTGpBsnl0sg OQxIRlF4mBm3VhmeqjkR5ItSBJ/Q7vndJ4OQZHl7vyICUnu0tTOE2UPRPVbGMiVdzmWu QwwA== X-Forwarded-Encrypted: i=1; AJvYcCVJoGHk35VloHKkLkNu0Eii9p338qXpcLdpUYGjHj1iQoWwEMKEHUxfgwjadyPQ1PHQytCPCeW74KVYGJAx@lists.postgresql.org X-Gm-Message-State: AOJu0YwiS79nLPiFK2ariUDvkQz1eES38UMenztyuW3Pf2peGH9+ebs4 d/l45hNBCR/9AZrH+78J/TibOwC6aEtbkMlv5YEBW/ZjPLkWdTEKTpicA2VNjQ98uII= X-Gm-Gg: AZuq6aIhW7rdfbOoNLrLIjw1k2woP1gO4mqnKvK7l0hqk5R1/yOV5N7wMg873Xx2Vd+ pqgPbkPKg6938rTFxvsQhtsKISXaacz77sV3ZI8dl1KCVl2XustGtDI1AzV0DoN+xkJXcQv0UtN FNHOankK31Raw+wz9y0/ibfAYAJFusdb6uDFDuUE/335Z77Ws+uZOdTI473QSzlmlQPaErobjsN Sf3dzXxxVfppozIQR65pIeySUvzQz0fFBpTXiZ8AL4RNuI2lH4ztW5+BDefYhbYoCT4bIhXfLX2 Hp2JVgAzaRRpWtceQpeUKSclIAvvU+pTkagroLXy0HnTg5dzyIQqohfw2j5vTGURZCE6Dste8YY LRDT4bnu3FTKlYguibF/0LAQ1K1BQHe7enuAtqMntAh43rRVlZ1rLeLqCKmdYVyB9f3O8qNM8rP pvaAoLtc7s52FpqSV1P+WA/wgaDPhsjidVYc1LjQ2XsKMeKPi5xoTa X-Received: by 2002:a05:600c:4eca:b0:483:6d42:25c6 with SMTP id 5b1f17b1804b1-48379be82acmr116186865e9.23.1771242742217; Mon, 16 Feb 2026 03:52:22 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:70:b35f:c18e:4ea7:5f6d:fb6b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4837b68e5adsm228184655e9.9.2026.02.16.03.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 03:52:21 -0800 (PST) Message-ID: Subject: Re: Question on execution plan and suitable index From: Laurenz Albe To: yudhi s Cc: Ron Johnson , Adrian Klaver , Nisarg Patel , pgsql-general Date: Mon, 16 Feb 2026 12:52:20 +0100 In-Reply-To: References: <818d0359d8b629a80b55b2e068dab958fc8e0a2a.camel@cybertec.at> <2fa62200cf92dc03dff20f8a42e45bb30fc40f35.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2026-02-16 at 16:09 +0530, yudhi s wrote: > I have updated the plan below. While trying to replace actual binds and > the objects with sample=C2=A0names some lines got missed initially=C2=A0i= t seems. >=20 > https://gist.github.com/databasetech0073/f564ac23ee35d1f0413980fe4d00efa9= =C2=A0 Thanks. Does the filter on "due_date" eliminate many rows in "orders"? If yes, and an index on that column would actually perform better (which you could test with enable_seqscan =3D off), perhaps your "random_page_cost" parameter is set too high. Where you can certainly make a difference is the repeated scan on "event_audit_log". An index on (request_id, event_comment_text, created_at= ) should speed up that part. Yours, Laurenz Albe