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 1mj00M-00059u-4m for pgsql-docs@arkaria.postgresql.org; Fri, 05 Nov 2021 14:15:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mj00K-0001cD-S2 for pgsql-docs@arkaria.postgresql.org; Fri, 05 Nov 2021 14:15:40 +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 1mj00K-0001c4-Go for pgsql-docs@lists.postgresql.org; Fri, 05 Nov 2021 14:15:40 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mj00I-0001CT-0I for pgsql-docs@lists.postgresql.org; Fri, 05 Nov 2021 14:15:40 +0000 Received: by mail-wr1-x430.google.com with SMTP id d3so13966465wrh.8 for ; Fri, 05 Nov 2021 07:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=QDYb/QSVMznCZF56iXpQwJMKlZhEkPLGYPhMhouIhpk=; b=eCar5xFwrNrB7+YFey+fYj5YaHurZ6knr1uORe0A8yPstJXff2rEHGfi+bdK5c0Bss QxJHocA2VzbA8Deeh8nneQwIKpVd0r4J+Y1wpWpkixneCiuhemX0PnkxZWZVScnWwDgs nk70UTsA9JL0RVOhOnqoxGuAfal+CNGux2zSg/bG+FEOWGyPgOPQMpWWI84DesvQw4PH OwfruRS+x1S9K0vBOlp3opkhu73vw4rqQ4gMXi0zh971QR1AJhMhcBq6KFYIL38MdoT+ Ocz4MiDPhqZvjWM4sAoqKummywCKW29LbcA2G356eg3fklKt8KA2ARYYkzPVw50msZdJ qBdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=QDYb/QSVMznCZF56iXpQwJMKlZhEkPLGYPhMhouIhpk=; b=StxPCG4bkgN+oGkBBO+TUojME6EPDwIgdEgKxq+KjAozC2zUxqIF1XZ0Qfr4xe0PJS YlQWdE02KG8kjSH2QBjYVnFoSC0y08zI/LfX0yunK3FScPJTkbk1jZ6afd0vQ7/5baim 65EqxCQB/3qo6yDqIidVwldNuOxqCPDcvqowRr5IhEDo4+OowHHtK0QsVd3eKuqV3q7N 0EKkIwX/Dq3YxlodmPCsAE7TKq05wOO5pP005K6CgsUA9BNqeft9LMovG9jVrU6bw7Bj UqqexumqIrNqA7U+2QH/wLeqDpHXJuyhZLXmGq1b6N2pNx6VVpXleddio8LGSOYRtDRL NTYQ== X-Gm-Message-State: AOAM5310sOtF/+JGig0eV2oEZqkZZPcJZ18Zr6JS8ot4QJBby550OYQs BmyZyoyuy7sqp+aeQ0TkkGLCjA== X-Google-Smtp-Source: ABdhPJzY3/M2Fr0TR6vDWpz8AkcTYCwMD4USgDzXZZQVFzjSZzV2celQb41K1IBOEJ5sROxI23OpYg== X-Received: by 2002:a5d:6e91:: with SMTP id k17mr73821493wrz.260.1636121736517; Fri, 05 Nov 2021 07:15:36 -0700 (PDT) Received: from localhost.localdomain (dynamic-e1ud0smzbsgy2dyfe-pd01.res.v6.highway.a1.net. [2001:871:5c:80aa:4290:6f46:351d:f98a]) by smtp.gmail.com with ESMTPSA id p12sm9794789wrr.10.2021.11.05.07.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 07:15:36 -0700 (PDT) Message-ID: Subject: Re: text fields and performance for ETL From: Laurenz Albe To: Grega Jesih , "David G. Johnston" Cc: Tom Lane , Pg Docs Date: Fri, 05 Nov 2021 15:15:35 +0100 In-Reply-To: <516dc58b80fa418091f5262879019213@actual-it.si> References: <163594615980.678.1904941309603792278@wrigleys.postgresql.org> <686716cb5c4242c28e5967d9b6fcfc75@actual-it.si> <137264.1635961048@sss.pgh.pa.us> <70cf9fe110c246afb4eab054caab0c04@actual-it.si> <516dc58b80fa418091f5262879019213@actual-it.si> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-2.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2021-11-05 at 09:51 +0000, Grega Jesih wrote: > Suggested current text addendum: > > But, if you consider doing ETL from Postgres database to some outer target > environment and you seek performance in such interfaces, follow the logic > of limited size (varchar or char) data types in your database model. > Because if you make a dataflow of known size types, interface code can take > a big block of data while for text fields you need to check each record. I am opposed to that. It is not our business to discuss the limitations of a certain third-party software product. If that were something wide-spread, perhaps. But I myself have never seen a problem with "text", as long as the actual size of the data is moderate.   > Optional additional remark: > > Another good aspect of known data sizes is easier understanding of field > content and implicit data (length) control. Something like that makes more sense to me. Perhaps, right before the tip you quoted, something like that: If your use case requires a length limit on character data, or compliance with the SQL standard is important, use "character varying". Otherwise, you are usually better off with "text". Yours, Laurenz Albe