Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6aC1-0008TA-UE for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 12:19:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6aC0-0000rd-JM for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 12:19:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6aC0-0000oS-50 for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 12:19:36 +0000 Received: from hz1.yz.to ([2a01:4f8:120:9383::2]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6aBw-0003sh-Oc for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 12:19:34 +0000 Received: from [172.17.6.34] (mail.tbz-pariv.de [146.0.121.193]) by hz1.yz.to (Postfix) with ESMTPSA id 1D62484BB4FA for ; Wed, 20 Mar 2019 13:19:29 +0100 (CET) Subject: Re: Performance of ByteA: ascii vs binary To: pgsql-general@lists.postgresql.org References: <20190319193727.34fgmdiipcxdgvn4@hjp.at> From: =?UTF-8?Q?Thomas_G=c3=bcttler?= Message-ID: <8edaa4a7-954d-61ad-9641-650ec5d7d643@thomas-guettler.de> Date: Wed, 20 Mar 2019 13:20:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190319193727.34fgmdiipcxdgvn4@hjp.at> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am 19.03.19 um 20:37 schrieb Peter J. Holzer: > On 2019-03-18 15:33:17 +0100, Thomas Güttler wrote: >> I did some benchmarking and in my setup there was major >> performance difference. >> >> I tested a ByteA column. >> >> If I used ascii data the tests took 52 seconds. >> If I used random binary data the test took 250 seconds. >> >> binary data is (roughly) five times slower than ascii data? >> >> Is this a know fact, or is there something wrong with my benchmark? >> >> I used Python and psycopg2. > > I don't see this here (Debian 9, Python 3,5, psycopg2 2.7.6, PostgreSQL > 9.5). > > I modified my bench-bytea script (https://github.com/hjp/blob-bench) to > restrict the byte values to printable ASCII (32 .. 126). There was > absolutely no difference, as the attached graph shows. Strange. I saw a big difference. What did you test? I tested inserts. Regards, Thomas Güttler -- Thomas Guettler http://www.thomas-guettler.de/ I am looking for feedback: https://github.com/guettli/programming-guidelines