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 1wdB50-003wLw-0Q for pgsql-general@arkaria.postgresql.org; Fri, 26 Jun 2026 18:15:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wdB4y-00C5ae-0L for pgsql-general@arkaria.postgresql.org; Fri, 26 Jun 2026 18:15:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wdB4x-00C5aT-0k for pgsql-general@lists.postgresql.org; Fri, 26 Jun 2026 18:15:03 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wdB4u-00000000OJR-0PPE for pgsql-general@lists.postgresql.org; Fri, 26 Jun 2026 18:15:02 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id 8E1401D0015C; Fri, 26 Jun 2026 14:14:57 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Fri, 26 Jun 2026 14:14:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1782497697; x=1782584097; bh=ngwE/lUKYn8F/lBuJBIIVlwFK8os0fcJSzZYbCRJbjw=; b= oh0RObln0cZcZQBmHIChHtCU1+uYOub2VCmyUZIag2/t8oRySnWHRDEd9kcikZBA ObP7ehXSpJ+bZHOTiupEly84Kk6vbey+aCsgiljgoyCHNeukxTNUppgu3+Hmba07 4SWNpyLKrEOUyVkZdSClQHkE4W7hM1BHIq2Ht3pPop1KuPNHIUIQ1AWdWYCT9p+I k5mU1oe6oIm9+UipVsx3NZgpe++lIgTavK1L7pU5Ke1O4LixPG0/BzrfXHJaUc8Z gvlyDqNkQag7XQg/fxZYLpZFgasGm4hY0rl+yNVvBm7JMKHSOIZ1+UhitCNxfvLV kNFQIJZpX0csx7YRPzoxcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1782497697; x=1782584097; bh=n gwE/lUKYn8F/lBuJBIIVlwFK8os0fcJSzZYbCRJbjw=; b=f0th3fJk4etSHQxDd D4v05HEQ+AM7Y204MyCh7F2P0tkjh6WHbk55PdpwvbMpbqihkdcNtrOYZsqAxHOA 4ou/hLP8twnb+SrulpB89dQ/4bNNBTOFHVqMtVE0tkvru0xeX4GjZQhzDWor7u6S 26WaeTE5jfWdwuNbvkqbsZyHd4h12iGTNerU5QoRMj89zUQqV+3YF5om9tGL1P/h 6iNVXZm7sD6TXfgN3LhYr+9FJVyODKlKZ0B/X/I0tbGHdfmiRcokw2oc7bK3Y+AZ NZnISlC5/DKEpKvUs1EaKlR4CYPC6BdSaN4RYaxYiKMZ3Sl/EfJR9vso9WhPKq8w OaipQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFASw9a1pwNFDoTrhhWh1jUHBw9VEYR6tokm35BgPF/63O+2ZGUpQxDr8toiFe2jF ZKfzH/sD4f3J4w7K0h3bWmjq4+N+OfTqiwMn20jM8jMMeQzf3TSgfHPBEdRKAjqUCaw0kJ vb5xNnU+joZNPsSLxpXMpkgQJnY6wEzJaWEIapXW3bJ6e7lX2RuLaw1X0uWko6E+WvUus1 GBgKodB5KMxTYEdrKucCK2zP8J011ifyAGR05SIJU1LKoWYYhgI40PZiLlYsHty/PZ2cal E3HWF/EP9SCyApJQI6ZUfzJ8OsdiNK5GtgRmYnbG9RqfdbEnwnssFZNE6YxBCKrKYnmTYv 2vZCncXSOaDy8+Bq8mRFyY92uIHMEMJKSHRALmaiQmURMhYHAgUuoyqBvPM4ArMU0g8IiT Ct4PTwS5SbYl37sVxDtH/HhVMqR7dkRj1H9Ebpv+Mq13ekq0vw5EUimsfRY/fI9PvAItxS RKeQpXzK+kETohxfz3d7ER0XY0aUEiQXrkKEiq1e/ihjJkC1Rzk59qKTm/J27IqgZZYiGt vkbmasDyW1PnS8xRggUVIZogP4HkQQzAR7I0HHt74+eTraHRElDloZlu2KX86rbEABsh0Y 5JVfH+AeHhgRxCprMW5P++HBiY4vk/KJfI1a276GTJ8+6nzhb60LQcgZ5JiA X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 26 Jun 2026 14:14:56 -0400 (EDT) Message-ID: <2ce465f0-f7f3-4c6a-9f68-b53439416336@aklaver.com> Date: Fri, 26 Jun 2026 11:14:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PostgreSQL 15-->18 slowdown? To: Israel Brewster , PostgreSQL General References: <4A6D9280-1409-42A8-9A1F-99E2A558E2BB@alaska.edu> Content-Language: en-US From: Adrian Klaver In-Reply-To: <4A6D9280-1409-42A8-9A1F-99E2A558E2BB@alaska.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/26/26 10:58 AM, Israel Brewster wrote: > In postgreSQL 15, I had the below query that worked quickly. Now, I make > no claims that the query is the best possible, or even a good query, but > it DID work, and it did so quickly enough to be un-noticable when running. > > Then I upgrade to PostgreSQL 18 - and now the query never completes (as > in, I get a command timeout after at least half an hour before I get a > result). Looking at the EXPLAIN (https://explain.depesz.com/s/llAQ > ) makes it pretty obvious why: we > have a sequence scan on a large table inside a nested loop - and that > sequence scan is apparently not short circuiting. The link provided shows no times or rows, did you pick the correct one? > > I tried the obvious: REINDEX database and VACUUM ANALYZE, but neither > helped. I have my default_statistics_target set to 500 at the moment. > > Then I tried SET enable_seqscan = off; Lo and behold, the query ran in > only 123.888 ms (fun number :-D ) - https://explain.depesz.com/s/K2K9 > This one does not show the actual query. > --- > Israel Brewster > Software Engineer > Alaska Volcano Observatory > Geophysical Institute - UAF > 2156 Koyukuk Drive > Fairbanks AK 99775-7320 > Work: 907-474-5172 > cell:  907-328-9145 >