Interestingly a version of this: CREATE INDEX TX_QSET_DIR_MAP_PRI_URI_TYP_UK ON tx_question_set_dir_map USING btree (question_set2tx_question_set ,uri_type, (CASE WHEN uri_type = 201900 THEN null::varchar(100) ELSE question_set_dir_map_key END); Worked for me. Try it if you are still interested.Just do proper casting of null (it was varchar(100) in my case).
Interestingly a version of this:
CREATE INDEX TX_QSET_DIR_MAP_PRI_URI_TYP_UK
ON tx_question_set_dir_map
USING btree
(question_set2tx_question_set ,uri_type,
(CASE WHEN uri_type = 201900 THEN null::varchar(100)
ELSE question_set_dir_map_key END);
Worked for me. Try it if you are still interested.
Just do proper casting of null (it was varchar(100) in my case).
This is a multi-column index - with the third column being an expression - as opposed to a single-column index of a composite.
David J.
________________________________________________________________________________
You are right.
But the question is whether OP needs a single_column_index_of_a_composite or multi_column_index will do.
Regards,
Igor Neyman
pgsql-sql by date:
Соглашаюсь с условиями обработки персональных данных