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 1gfRvm-0001WV-8S for pgsql-general@arkaria.postgresql.org; Fri, 04 Jan 2019 16:02:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gfRvk-0004bO-2a for pgsql-general@arkaria.postgresql.org; Fri, 04 Jan 2019 16:02:40 +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 1gfRvj-0004Za-Mf for pgsql-general@lists.postgresql.org; Fri, 04 Jan 2019 16:02:39 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfRvh-0004OB-Ao for pgsql-general@lists.postgresql.org; Fri, 04 Jan 2019 16:02:38 +0000 Received: by mail-pg1-x533.google.com with SMTP id z11so17689200pgu.0 for ; Fri, 04 Jan 2019 08:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=ntRggU9QGJ9gY0qh3LqSI5KBLNEwriLTjgPt/TJu7tQ=; b=vKMinPU/F11/Dxp67p/Lffg1aiZLsZ4ESQjizBGm0kn+1hQ5TPKbtiFpShy4Hz6t4H vXBWrJ75PlUP5qRiYKcSLcsXbQw28oPexpUv9MRW5sGtpBSL0xJybheE9vrWVhkYmLJp VxlXmY0evuGXzPCTIfUVpjWA7P1Mj9wAZ7LrYd7M62mIEzIpT139q3Tsxe2XMX9teSbM Y7IEQ6R+3PDdXmfj2rOI7KWqXlBTfEb/RDwvL8MBvgs4QTap6caI+8ADIW87MYFMnDuS eItajSZ9C7WjsyA3kVAaATvt5c1KpFB15v9WmnlnDnfVwFtnvb2glD7yJXH4w7Q8CzYB LUJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ntRggU9QGJ9gY0qh3LqSI5KBLNEwriLTjgPt/TJu7tQ=; b=V3WU10vLID55/y3IWaha1Kf42Isdr4Yudz/lxwe7tVrgd0Ovjq8NAKF24Jk+ty1HHI rUCDjCJW6XdetaPKte7yMz4GSBK2HpQjm4JL7s4NaPpTx09xtI3SK3htqU5emZ1AqLTB RO1gmD8Vqsb7DKS63HCH9+wzP4f/B8cgfqN2L63vsPxFnGxqVjx3o6R+4tx0lzn7rmA5 oEHU6oe064Jvh8u/ZdXc5jBWqfjwUEBo13R7KYx5k0hhBofFV/C0R3amfVU41YyX1678 xuoxgVSUSEf9hnKQiU90nmzawHXSNgx7o12cvbXMGoaZI1ThmP2WgSzReYRp2GWxb2jj /yFA== X-Gm-Message-State: AJcUuke3T8uJsm+Kue+fEJ5mIjI0rF0aotZ+NhzyTIf+AUw8kBJsf+M4 8ZauvZ/8qITuY62IgFpb7qZIUY++ X-Google-Smtp-Source: ALg8bN6fTna++a7+cgr1khncByo13bE7AsRaImoKJmgpglF9IN2dYJ3lJnX1Hk52p/GQ3meWe1H86w== X-Received: by 2002:a63:160d:: with SMTP id w13mr2158514pgl.43.1546617755749; Fri, 04 Jan 2019 08:02:35 -0800 (PST) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id p24sm96764439pfk.155.2019.01.04.08.02.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 08:02:35 -0800 (PST) Subject: Re: Use bytearray for blobs or not? To: pgsql-general@lists.postgresql.org References: <07d16f3f-0352-7802-ef1c-bd9987ec623b@matrix.gatewaynet.com> From: Rob Sargent Message-ID: Date: Fri, 4 Jan 2019 09:02:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <07d16f3f-0352-7802-ef1c-bd9987ec623b@matrix.gatewaynet.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/4/19 4:48 AM, Achilleas Mantzios wrote: > On 4/1/19 1:41 μ.μ., Thomas Güttler wrote: >> Some months ago I wrote a little application with Python+Django which >> stores >> blob data in bytearrays. >> >> It works. >> >> In the future there will be a lot more traffic, and I am unsure >> if this is really a good solution. I know this is more FUD than >> concrete PG issue. >> >> What do you think? > > Performance (at least for JDBC) is known to be better with blobs. Do you have any details on which part is slower with bytea? Original insert, read back to client, general (p)sql access.  I'm moving towards bytea but still have time to change my mind if I cannot afford the performance hit. > However, with bytea life is just easier for many reasons (backups, > logical replication, other types of replication, sys management, etc). Yes, and in my case I even get a cheap compression from the original file. > >> >> Which alternatives could be useful? >> >> Regards, >>   Thomas >> >> >> >> > >