Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aszzs-0005id-Ei for pgsql-performance@arkaria.postgresql.org; Wed, 20 Apr 2016 21:49:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aszzr-0001kl-Cp for pgsql-performance@arkaria.postgresql.org; Wed, 20 Apr 2016 21:49:19 +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.84_2) (envelope-from ) id 1aszzq-0001kf-SC for pgsql-performance@postgresql.org; Wed, 20 Apr 2016 21:49:19 +0000 Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aszzj-0007rr-Ie for pgsql-performance@postgresql.org; Wed, 20 Apr 2016 21:49:17 +0000 Received: by mail-oi0-x22d.google.com with SMTP id p188so64347902oih.2 for ; Wed, 20 Apr 2016 14:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=kSclXm4Eb0sE6AtG9TF0Q+b1qKRTFe6injW/5CmUu94=; b=pwinbRItv2tFqPadtgMY7XlmMKL1z9/nme+s+W2K02D+lJPyF4fnO02WtZvEHketfo mj/nr8ocF23dGL6emTSdhKwAY3ImG4VCrbxyHHkuYCthT6YZyUwR3PaIdghFBwmqbgOn 68p3h4z7qAXmXqB7nZgfPup6LNMx+D4ZQc35gASgYEM4nvvGbzqBJETs89LhEvTsTANU w9Tob5VuYww63P0lf2BdU7Rced4TkRzwEohKZoP50at/7lW+wKs9sd/+knerbKc7cxZL fveUuy+JzcwejvDyn00nDvSdnV0EhQ6v0wfVppBmIdrYgKv8+64kKUGhgVQleXKe6Ik0 kF+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=kSclXm4Eb0sE6AtG9TF0Q+b1qKRTFe6injW/5CmUu94=; b=GWmjyvLibKppgBUPClaNJV/+/KlAVlTL03JUGyRkbmvbb4TpNfPzuzqhsRoTbThj/B /Z1oSKgsqCVf7DGDQOX5M8sdyXn2pdniC+Ie4L1JqDWcjfhXKFWdrDI544qnXT6pAAXi UVuTiTDqRxen9OxgV8a0wdN7iMlmpZtg4C8NtMS7wc+0yb08+b+Y8DURyrM20UQx+Jjk IHN9+oL+YveH3A7FKkIDZcZdV/1xBdJH/sdPaT6eIhO2K96wN9GpVCA69gnY4T4N50dQ EKrjI645ZF8qyl/M0n/tR6qUxg/Ih5S5XMBgOXSDBWYbd5wG/E9tDRkSi7BhSdR4bzzG G1Xg== X-Gm-Message-State: AOPr4FWOzUrtXH5Wecxx12YyHLg+64aLb0y3rpU4QGFYMEqIOvYsh6TJ0lGJZXXaPIZPfoY1Bg/fmUgjGJwWKA== MIME-Version: 1.0 X-Received: by 10.157.8.244 with SMTP id 107mr4430569otf.109.1461188950678; Wed, 20 Apr 2016 14:49:10 -0700 (PDT) Received: by 10.157.47.245 with HTTP; Wed, 20 Apr 2016 14:49:10 -0700 (PDT) In-Reply-To: <5717D07E.3070802@sigaev.ru> References: <5717D07E.3070802@sigaev.ru> Date: Wed, 20 Apr 2016 14:49:10 -0700 Message-ID: Subject: Re: Performant queries on table with many boolean columns From: "David G. Johnston" To: Teodor Sigaev Cc: Rob Imig , "pgsql-performance@postgresql.org" Content-Type: multipart/alternative; boundary=001a113734c25ae9f50530f190be X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --001a113734c25ae9f50530f190be Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Apr 20, 2016 at 11:54 AM, Teodor Sigaev wrote: > >> The obvious thing seems to make a table with ~100 columns, with 1 column >> for each boolean property. Though, what type of indexing strategy would >> one use on that table? Doesn't make sense to do BTREE. Is there a better >> way to structure it? >> >> looks like a deal for contrib/bloom index in upcoming 9.6 release =E2=80=8BCurious, it doesn't look like it will work with booleans out of th= e box. http://www.postgresql.org/docs/devel/static/bloom.html David J. =E2=80=8B --001a113734c25ae9f50530f190be Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Ap= r 20, 2016 at 11:54 AM, Teodor Sigaev <teodor@sigaev.ru> wrote:

The obvious thing seems to make a table with ~100 columns, with 1 column for each boolean property. Though, what type of indexing strategy would
one use on that table? Doesn't make sense to do BTREE. Is there a bette= r
way to structure it?

looks like a deal for contrib/bloom index in upcoming 9.6 release

=E2=80=8BCurious, it doesn't l= ook like it will work with booleans out of the box.


David J.
=E2=80= =8B
=C2=A0
--001a113734c25ae9f50530f190be--