Re: querying both text and non-text properties

2018-12-06 Thread Tony Shelver
I would suggest doing testing out btree_gin with a non-insignificant amount of data before going ahead with it. I did a test case last month, and the size of the generated index was _much_ bigger than the base table. The case involved a compound key if 1 int column and 1 timestamp range column. O

Re: querying both text and non-text properties

2018-12-05 Thread Rob Nikander
> On Dec 4, 2018, at 4:59 PM, Laurenz Albe wrote: > > You have two options: > > A combined index: > > CREATE EXTENSION btree_gin; > CREATE INDEX ON fulltext USING gin (to_tsvector('english', doc), color); > > That is the perfect match for a query with > > WHERE color = 'red' AND to_tsve

Re: querying both text and non-text properties

2018-12-04 Thread Laurenz Albe
Rob Nikander wrote: > I’ve got an application where I’d like to search a collection of objects > based on various properties, some text and others non-text (bools, enums, > ints, etc). I’ve used full text search before, following the PG docs to > set up a index on a ts_vector. And of course I’ve us

querying both text and non-text properties

2018-12-04 Thread Rob Nikander
Hi, I’ve got an application where I’d like to search a collection of objects based on various properties, some text and others non-text (bools, enums, ints, etc). I’ve used full text search before, following the PG docs to set up a index on a ts_vector. And of course I’ve used normal indexes b