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 1vnIwM-004tA2-1B for pgsql-general@arkaria.postgresql.org; Tue, 03 Feb 2026 16:07:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vnIwL-005h6t-1M for pgsql-general@arkaria.postgresql.org; Tue, 03 Feb 2026 16:07:45 +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 1vnIwK-005h6l-19 for pgsql-general@lists.postgresql.org; Tue, 03 Feb 2026 16:07:44 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vnIwI-00000000NkI-0m2I for pgsql-general@lists.postgresql.org; Tue, 03 Feb 2026 16:07:43 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 31F5A1D00136; Tue, 3 Feb 2026 11:07:41 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Tue, 03 Feb 2026 11:07:41 -0500 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=fm2; t=1770134860; x=1770221260; bh=tv5sLqeWi5nPYvjI7BBvA14NpQ2e8hDdituku0OnN+o=; b= Qn670lAqIOycw3dB26ycwRl/nISV6/eSCYHVbMvX6l/JdfTh8+8ZSIfsmJjohhYT QhfrPrwIpmLdewTvB08dGa4yAPuGKkrdOk1xcmciU2RoK3sjSND5yyGo7Oq2+tmB WuP32nkHT62IpWv6AuGtMxzXOsqExBOwepp1CwfpZFlNtssQiS8Wm0hOilJrN8nB ZXn9np/xMcQAh8TMhm5dcynArn8tuB9H3zrJH/NmQi4N0LLoeIzjBYvMMawJ69jc ZcnQ2r4+hamNwgbnNDEkhs0+0JCy9UJksiLQsi01+IpLx7TcNTCENYZjRo86SxfC oFLLrXn511+ir56Vx6JePw== 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=fm3; t=1770134860; x=1770221260; bh=t v5sLqeWi5nPYvjI7BBvA14NpQ2e8hDdituku0OnN+o=; b=tQcl8xUKN0Si0XzRT YcUA2k0LlM1iNdaLwIwo7Axy49WjktsJJ+9VD5PbT2jzo4aDWyM8Smhl1lVbAL7l APBIk/B4FfRM2p00FmMgm3leoYHjcITm/jxmbACwZhfTPOjczyVXynx31JP3Dn5D AUlWFSi4QmZ7cLgGTYOliHSIA/BPxOZV31sUXx4HNsFUTPFvRi6ivX9y5g9iYp4s Zj0gDkhjdUmWwwS5ceDWiyUEVDDGYDL6B3uMLyhwCGc0QU0j1vHg4YQTf10o6AwZ Xa0UqrLGTK0VLnMWu/42n6E+56JALjowvy+inD7LSBV9EeZZ9kN29LWqYE7WQKPp DWzSw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddukedtgeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpeelgeevkeekkeeuiefgtdevieeluefhfedufeetkeejffek jeeujeehgeehgeektdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhoug gvpehsmhhtphhouhhtpdhrtghpthhtoheprhhonhhljhhohhhnshhonhhjrhesghhmrghi lhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpoh hsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 Feb 2026 11:07:40 -0500 (EST) Message-ID: <55d333e9-5172-4ece-9723-a64d6137acee@aklaver.com> Date: Tue, 3 Feb 2026 08:07:39 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Top -N Query performance issue and high CPU usage To: Ron Johnson , "pgsql-generallists.postgresql.org" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: 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 2/3/26 07:59, Ron Johnson wrote: > > > There is no VARCHAR or CHAR; there is only TEXT.  Thus, this is 100% > expected and normal. What Ron is saying is that there are varchar and char types, but they boil down to text per: https://www.postgresql.org/docs/current/datatype-character.html "text is PostgreSQL's native string data type, in that most built-in functions operating on strings are declared to take or return text not character varying. For many purposes, character varying acts as though it were a domain over text." As to performance see: " Tip There is no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead. " > > -- > Death to , and butter sauce. > Don't boil me, I'm still alive. > lobster! -- Adrian Klaver adrian.klaver@aklaver.com