I have table with tsvector column, also I create index for that column. Also I have some columns(and indexes for those columns) which required for search.
For example: Table: Vacancies
Columns: title, description(title + description = tsvector), salary(int value with index).
I want find all vacancies with text which contains in title+description and also by salary > 1000.
What column will be the first condition.
SELECT * FROM vacancies WHERE title_description_tsvector @@ plainto_tsquery('php developer') AND salary > 1000; OR
SELECT * FROM vacancies WHERE salary > 1000 AND title_description_tsvector @@ plainto_tsquery('php developer');
ANDis irrelevant. Both queries will return the same thing.explain analyze select ....and you will see