Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL - Mailing list pgsql-general

From David G. Johnston
Subject Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL
Date
Msg-id CAKFQuwZDXRq0cbMH501e1OMe8kZV=uoT7PiN8+7D6OrJBjLPJg@mail.gmail.com
Whole thread Raw
In response to Huge input lookup exception when trying to create the index for XML data type column in postgreSQL  (Sai Teja <saitejasaichintalapudi@gmail.com>)
List pgsql-general
On Thu, Sep 7, 2023 at 12:28 PM Sai Teja <saitejasaichintalapudi@gmail.com> wrote:
Here we’re using Xpath expression to create the index since postgreSQL directly does not support comparison methods. So, we decided to use Xpath expression. But while creating the index as I mentioned above we’re facing the issue with Huge Input lookup

It doesn't support comparison methods of stuff like this because doing so tends to be pointless or very expensive, setting aside the fact that, as you probably are seeing here, records in an index must be small enough to fit on a physical page and large bodies of text typically don't.

If you truly want to perform equality checks on large bodies of text the typical solution is to hash said text and then perform a comparison against hashes.

Since you are producing an array you might be able to get something like a GIN or GIST index to work...I'm not all that familiar with them but they were designed for non-atomic data values.

David J.

pgsql-general by date:

Previous
From: Erik Wienhold
Date:
Subject: Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL
Next
From: Tom Lane
Date:
Subject: Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL