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 1hGOgt-0003Va-03 for pgsql-general@arkaria.postgresql.org; Tue, 16 Apr 2019 14:04:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hGOgr-0000E5-Dh for pgsql-general@arkaria.postgresql.org; Tue, 16 Apr 2019 14:04:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGOgr-0000Dy-1w for pgsql-general@lists.postgresql.org; Tue, 16 Apr 2019 14:04:01 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGOgo-0007QT-3w for pgsql-general@lists.postgresql.org; Tue, 16 Apr 2019 14:04:00 +0000 Received: by mail-pg1-x541.google.com with SMTP id g8so10421172pgf.2 for ; Tue, 16 Apr 2019 07:03:57 -0700 (PDT) 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=mrF2dZ2fDLxVipVcUTEtlc9r+Z51/gHJzkPMXJTX0c0=; b=Qf5EcXmU9ahDwAwIM/vXIwe+dnsnxfyTyU/7750C9crC3QzgKAEXmwWWUWa4Rr+2Mk S3n9wlSSF70OflThlLNxdWs8zYeWPTXkf+HNhpAUr6bM8T0iGc7nljNh8AGv6bwGNxSP BSCC0KgX/YO5qI4ss+xqSAJSjkEwgHB2yWcdhKCx3KHs7CX9+hHaW1O552h+IHJivxlX yGXuVn6GI0sfLdpyoYRlsWKtGypUDnFVUlSpz0I6ii950Ss7E+7QS+oZiABKBAVDbjKT 4QJuhG0NmLEGLRGaZs8JYlkhMhrcro/8DN7U0is+4tJAjJYPDjTdyrz01Fdx+U0x6BSq LFQA== 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=mrF2dZ2fDLxVipVcUTEtlc9r+Z51/gHJzkPMXJTX0c0=; b=KD2jKLBouYJHdGuuk683h8wpRfnpyvosh7StsVJ/xVTxv6bkk6Dt0O09oXEJtk22G7 FkECBD6tN7rvot76gXk8lGkOx9VRCixNed6dpCw8cOc4e4XoMPQKrypvsHUdW2a3o8uf 93gr23oVwZz1vU00AAkoNDSVc5DM2YQQ0B5sq5YLDFqwzQcvtAfhdn216eOmeCHHr62X JrrogFXqbqyhXzOi9JisC1vaqSLz6hsP1gppLF/8bjd2NAOWUKdT4fjUFAMWfTqmCne1 oxiGEGwDZMko0ABXeyOIgJucmoKxzTJtk3/SnrBFNHWcyZ+whRGDi8X30IRV1jT3D1Ta AdnQ== X-Gm-Message-State: APjAAAWzwk7spjfJ6UvtVbjOc8iHwPl5EZX4LcErQbz3IIrd27KSFn2P 90AI8WB/VFe+G+B5KxaVXeW8JZmc X-Google-Smtp-Source: APXvYqx771kaQLvvYeLTtQeOj/ojQn+emFxB1w9oQoozSBrp2Z2xGPI3TvtjsiFJOVfXnI9RuNrlZw== X-Received: by 2002:aa7:8b4c:: with SMTP id i12mr76596639pfd.189.1555423434644; Tue, 16 Apr 2019 07:03:54 -0700 (PDT) Received: from ?IPv6:2601:646:c201:b55:359f:2cd9:62aa:b009? ([2601:646:c201:b55:359f:2cd9:62aa:b009]) by smtp.gmail.com with ESMTPSA id h4sm67899791pfo.119.2019.04.16.07.03.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 07:03:52 -0700 (PDT) Subject: Re: Storage Inefficiency In PostgreSQL To: pgsql-general@lists.postgresql.org References: <003401d4f367$1c613260$55239720$@silverpowersystems.com> From: Kevin Wilkinson Message-ID: <726f46f3-3a20-50a8-6105-607bc9d2c575@gmail.com> Date: Tue, 16 Apr 2019 07:03:52 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <003401d4f367$1c613260$55239720$@silverpowersystems.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk we were able to use a brin index for our time-series data and that saved a lot of space. basically, we used a btree for recent data and, once the data was "stable", reclustered the data to get high correlation on the brin index, created a brin index and dropped the btree. it works well. On 4/15/2019 1:42 AM, Ray Cheung wrote: > Hi , > > We are currently contemplating switching from MySQL to PostgreSQL, the main > attraction being the use of the TimescaleDB extension. Having done much of > the ground investigation there is one area of significant concern - the > storage requirement of PostgreSQL. Put simply, comparing like for like for a > set of tables, PostgreSQL consumes far more storage space than MySQL: > > - MySQL (5.6): 156 MB > - PostgreSQL (11.2): 246 MB > - PostgreSQL + TimescaleDB (partitioned/chunked data): 324 MB > > I've also submitted this in stackoverflow: > https://stackoverflow.com/questions/55655272/how-to-reduce-postgresql-databa > se-size. > > I can rearrange the table/column-alignment to save 6 bytes per row of the > main table, with a saving of a few mega-bytes. Not enough to make any real > difference. Does anyone know: > > - Why PostgreSQL is so storage inefficient in comparison? > - What existing methods can be used to reduce the storage consumption (I've > already tried realignment and vacuum full)? > - Are there any plans to address this storage consumption inefficiency (in > comparison to MySQL) problem? > > Many thanks, > > sps-ray > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > >