Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLYo-0007As-0L for pgsql-general@arkaria.postgresql.org; Wed, 25 Apr 2018 14:38:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBLYm-0000Mx-Uk for pgsql-general@arkaria.postgresql.org; Wed, 25 Apr 2018 14:38:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLYk-0000Mn-VH for pgsql-general@lists.postgresql.org; Wed, 25 Apr 2018 14:38:16 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLYg-00056Q-4W for pgsql-general@lists.postgresql.org; Wed, 25 Apr 2018 14:38:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7DA72215B2; Wed, 25 Apr 2018 10:38:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 25 Apr 2018 10:38:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=20GVdGanstRxsTehe1KtbaVzBJu3I qtb51crDtbpGzc=; b=f199MB6xSwtzSmMXnLEGcgPtwNeWlRjdBB8KF9v6uZ33Y Cdi1l+h6GkmSO+YASNvUm/+UyIYXcEuPOupskGWL/BT+44NjoBjuG8oK3x0lZwhD qduwrRqLYA8qgIAtU1zp16tIrqYVSbjX9amX+OMaCpQ+C6UItM3XW0PgrgosCUQ0 dt0y+Jg1ure4t9Rx9Nna8liDd5piye9EZmiq6dSx9Y0c19iYtEHuv+S2EUc+Phgz EgoiXE+hI1WlPZgljjcKnEDGloNaUZgXmJxhaY+Gb2od65/3L/WadyPaMJArPYw8 /gSs1bFVbAyjb8AxlEP8H6NUbT5NxFlh1H/6sCzqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=20GVdG anstRxsTehe1KtbaVzBJu3Iqtb51crDtbpGzc=; b=GMAWRaTj1uw/swtGr+L2ig km3T7Qa3RA+gCkyzXubhtFPWe+BXTDWRF0N4PnAPwLdXayrhEbl+Dyjt2eYhdme8 c0PWkQXWqmOYjhOpHwECZ/VegRl4UwWoQHizlzQbXZ1gZK7ZeyXP2+pSxFuOTvwv oQ3I0PtO115D0gJvXZAJTa7fdJfCUbS2hi8tmw6nrP48OXJNPsgEGS3v3MDmX+H7 O1spDjcp+wfRaxCr+MHQD6ZFpIOKjQwOPPhWYUap8pt3TztC4kjKLK4dAPSwZlhN cvM9v3o1wSVXZhxqVsApzw38MXoMK3xe7lRZcXG1iAWec6+R/+0N+Soxojaw6t7Q == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id B9394E47F2; Wed, 25 Apr 2018 10:38:07 -0400 (EDT) Subject: Re: Strange Index sizes To: Mohsen Bande , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Wed, 25 Apr 2018 07:38:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/24/2018 11:41 PM, Mohsen Bande wrote: > Hi all, > I have a user table with ~8M records, with different type of fields > b-tree indexed. Could we see table schema and index statements? > by investigating index sizes, i found two strange things: > 1- all index sizes are almost the same, regardless of field type > (boolean, string, bigint) What was the command you used to determine the sizes? > 2 - all of them are much bigger that my expectation, e.g. for a boolean > field, even after reindexing, the size is 217MB, so each record takes > ~27 bytes. > > could some one shed some light on this please? or refer any user > oriented documentation about index size estimations -- Adrian Klaver adrian.klaver@aklaver.com