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 1kHyTV-00079N-AD for pgsql-general@arkaria.postgresql.org; Tue, 15 Sep 2020 00:05:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kHyTS-0008Sn-Fq for pgsql-general@arkaria.postgresql.org; Tue, 15 Sep 2020 00:05:30 +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 1kHyTS-0008Sg-8W for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 00:05:30 +0000 Received: from ook.raf.org ([139.99.156.21]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kHyTP-0002a6-PB for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 00:05:29 +0000 Received: from localhost (localhost [127.0.0.1]) by ook.raf.org (Postfix) with ESMTP id 5BD945DE31 for ; Tue, 15 Sep 2020 10:05:22 +1000 (AEST) X-Virus-Scanned: Debian amavisd-new at ook.raf.org Received: from ook.raf.org ([127.0.0.1]) by localhost (ook.raf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P_2f3-BUnMII for ; Tue, 15 Sep 2020 10:05:21 +1000 (AEST) Received: by ook.raf.org (Postfix, from userid 1001) id 893435E26D; Tue, 15 Sep 2020 10:05:21 +1000 (AEST) Date: Tue, 15 Sep 2020 10:05:21 +1000 From: raf To: pgsql-general@lists.postgresql.org Subject: Re: Can I get some PostgreSQL developer feedback on these five general issues I have with PostgreSQL and its ecosystem? Message-ID: <20200915000521.56vucbshwgs24fkm@raf.org> References: <1176808.1600119597@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1176808.1600119597@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Sep 14, 2020 at 05:39:57PM -0400, Tom Lane wrote: > tutiluren@tutanota.com writes: > > 1. All non-ANSI characters are turned into "?"s for application_name. > > Yeah, that's hard to do much with unfortunately. We cannot assume that > all databases in an installation share the same encoding, so for globally > visible strings like application_name, the only safe solution is to > restrict them to ASCII. > > On the other hand, the very same thing could be said of database names > and role names, yet we have never worried much about whether those were > encoding-safe when viewed from databases with different encodings, nor > have there been many complaints about the theoretical unsafety. So maybe > this is just overly anal-retentive and we should drop the restriction, > or at least pass through data that doesn't appear to be invalidly > encoded. Perhaps recode database/role names from the source database's encoding into utf8, and then recode from utf8 to the destination database's encoding? For "globally visible strings", maybe recode to the client_encoding setting, or a new encoding setting for this purpose since client_encoding seems to be linked to the database that the client is connected to. I'd've thought that the application name would arrive encoded as client_encoding (which defaults to the database encoding). Maybe globally visible strings need to be recoded on arrival from the client_encoding to utf8 (or a "server_encoding" or "global_encoding" setting) so they are always stored in a known encoding so they can be recoded as necessary when viewed via connections to other databases using a different encoding. Just some thoughts. If they don't make any sense, feel free to ignore them. :-) > > 5. Ever since my early days with PG in the mid-2000s, I've tried > > numerous times to read the manual, wikis and comments for the > > configuration files, specifically the performance directives, and asked > > many, many times for help about that, yet never been able to figure out > > what they want me to enter for all the numerous options. At this point, > > it isn't me being lazy/stupid; it's objectively very difficult to > > understand all of that. > > We do the best we can as far as the documentation goes; if you have > concrete suggestions about how to improve that, we'll surely listen. I thought the documentation on postgres performance tuning was fine. Here's what I got from it (for a dedicated database server host): shared_buffers = 1GB # Should be 1/4 of RAM work_mem = 16MB # Should be bigger to do more sorts in-memory but it's per sort per user so not too big maintenance_work_mem = 128MB # Should be <= 256MB to make vacuum fast without taking away too much RAM from other tasks min_wal_size = 480MB # Should be at least 3 * 10 * 16MB to avoid too many checkpoints slowing down writes checkpoint_completion_target = 0.9 # Should be 0.9 if checkpoint_segments was increased to spread out checkpoint writes random_page_cost = 4.0 # Should be 4.0 for HDD, 1.5-2.5 for SSD, 1.0-1.01 if db fits entirely in RAM effective_cache_size = 3GB # Should be 1/2 to 3/4 of RAM It's the "Should..." comments that matter. And it might be out of date... Actually, it is out of date. The comment for checkpoint_completion_target refers to checkpoint_segments which no longer exists (since 9.5) so disregard that. cheers, raf