tsearch2, large data and indexes - Mailing list pgsql-performance

From Ivan Voras
Subject tsearch2, large data and indexes
Date
Msg-id CAF-QHFUaRk-v4bnTUQ0_eepH0MEKaCaVM-fwiTP1uxM8EgKQVw@mail.gmail.com
Whole thread Raw
Responses Re: tsearch2, large data and indexes  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-performance
Hello,

If a table contains simple fields as well as large (hundreds of KiB)
text fields, will accessing only the simple fields cause the entire
record data, including the large fields, to be read and unpacked?
(e.g. SELECT int_field FROM table_with_large_text)

More details: after thinking about it some more, it might have
something to do with tsearch2 and indexes: the large data in this case
is a tsvector, indexed with GIN, and the query plan involves a
re-check condition.

The query is of the form:
SELECT simple_fields FROM table WHERE fts @@ to_tsquery('...').

Does the "re-check condition" mean that the original tsvector data is
always read from the table in addition to the index? That would be
very wasteful since data is practically duplicated in the table and in
the index. Any way around it?


pgsql-performance by date:

Previous
From: Vishalakshi Navaneethakrishnan
Date:
Subject: Hot standby 9.2.1 PANIC: WAL contains references to invalid pages
Next
From: Sergey Konoplev
Date:
Subject: Re: Hot standby 9.2.1 PANIC: WAL contains references to invalid pages