| From: | Igor Neyman <ineyman(at)perceptron(dot)com> |
|---|---|
| To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
| Cc: | Michael Moore <michaeljmoore(at)gmail(dot)com>, postgres list <pgsql-sql(at)postgresql(dot)org> |
| Subject: | Re: simple function index question |
| Date: | 2016-03-23 16:30:18 |
| Message-ID: | A76B25F2823E954C9E45E32FA49D70ECCD68075F@mail.corp.perceptron.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Emi | 2016-03-23 18:00:36 | query based on row number for psql8.3 |
| Previous Message | David G. Johnston | 2016-03-23 16:10:54 | Re: simple function index question |