Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ougbn-0004Dy-If for pgsql-novice@arkaria.postgresql.org; Mon, 14 Nov 2022 21:03:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ougbm-00083u-C3 for pgsql-novice@arkaria.postgresql.org; Mon, 14 Nov 2022 21:03:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ougbm-00083l-06 for pgsql-novice@lists.postgresql.org; Mon, 14 Nov 2022 21:03:10 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ougbh-0001lm-0J for pgsql-novice@lists.postgresql.org; Mon, 14 Nov 2022 21:03:09 +0000 Received: by mail-ej1-x62f.google.com with SMTP id i10so22730966ejg.6 for ; Mon, 14 Nov 2022 13:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=cZvM3w9wXnVkBl6YE93EEaAevRty2LJ3xskgKq2Sljg=; b=RQucPe4FAQXBlCsmAW/6b1L48tk9zQUBK3+Hr2vXFPT/HKmJfCjK7U45A3qoMu53TD CJ39p3207N9TKWsI0PySQOWc0BBrp/YZXT1rH0GZ3hDZsBHgjdnU0CK/dW81vOpzNKBu 3VtBo9WSdhV1w/PMU1FRrEI6VxQOCvWK+3UkOIht+794tCQZKU+flge+il9siqITJqtS fYfugsNS7PRisCYS1fGQwYT54Z5Ypwbo2jAsOD+SiUSr9XXOldbEqkwU67ZqAeAKUU/Q IQkIFzFXTSZ6gRg0J7kldTjK+FDgpyOQkPogfd/IzbB0rF7gatkPLxEZekwO4tvrOhQP me5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cZvM3w9wXnVkBl6YE93EEaAevRty2LJ3xskgKq2Sljg=; b=NH9uxJ2IydviuESKOo/9/HGBb4MqchiuUEvKlQcOR/fwkBIGTpZ28tLikOX3b6o5I6 +n0RjDGekme9xB/+1/3X1l4YO3vfyMc0aeTZgReMxhqKAIYWbtQuMFTLmJQwyKxqzFq1 hrZ2/BwgfYOpHUBxAbDPnWZ3Yg4fy2/v+gSO46eBLKQuWV/itvDGuXmgRmPfOUvOrh+d zrMObaLJA3gueat3R3q/rRBx8TOx8HifxG0leF5G8IyroMt0HSKfUgYDkYHuIMZSjjtz S9UTX6jLByUyRDWOsLKIe/Z2fReabqaRgBJf/DGmocm4pPzewejYXcj1XAb37VwFxXLS j0GA== X-Gm-Message-State: ANoB5pnlWMxdd2u8uLULM6GwVH91A9BZBsHgRsrYsSpB7dw4928riSSD GE/8uMXDG9raWq9qM8d08bkgItie41oaog== X-Google-Smtp-Source: AA0mqf4BwHkg/fYrP8r2xNWFrWHeA/v2zefxrl3wFSxv0eiUUhvoaEqKdV2NRnfRgvpp7nHB3JuhyQ== X-Received: by 2002:a17:906:9f08:b0:7ad:da22:c396 with SMTP id fy8-20020a1709069f0800b007adda22c396mr11697504ejc.653.1668459783985; Mon, 14 Nov 2022 13:03:03 -0800 (PST) Received: from localhost.localdomain (178-190-182-188.adsl.highway.telekom.at. [178.190.182.188]) by smtp.gmail.com with ESMTPSA id 16-20020a170906311000b007add1c4dadbsm4598847ejx.153.2022.11.14.13.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 13:03:03 -0800 (PST) Message-ID: Subject: Re: hstore or jsonb ? From: Laurenz Albe To: Bzzzz , pgsql-novice@lists.postgresql.org Date: Mon, 14 Nov 2022 22:03:02 +0100 In-Reply-To: <20221114155057.48406b86@msi.defcon1.lan> References: <20221114155057.48406b86@msi.defcon1.lan> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2022-11-14 at 15:50 +0100, Bzzzz wrote: > I'd like to store specs, as they vary a lot from one item to another, > hstore or jsonb look like the best solution. > > Specs can have 2 levels at most. > ie: "color": ["white", "black", "blue"]). > > The indexation is mandatory for fulltext accurate researches in > (almost) natural language. > > So, as the processing is almost the same (maps I/O in Erlang), which one > would be the best for my needs, hstore or jsonb ? "hstore" is obsolete; don't use it. > Also, from what I read, the both of them can be easily indexed, but > which index is the best, GIN or RUM ? > > And furthermore, which index option (XXX_ops), if any, would be the best > for the chosen one ? That depends on the query you need to support. I have no idea what you mean by "fulltext accurate search" in a hstore or JSON. Yours, Laurenz Albe