Re: simple function index question - Mailing list pgsql-sql

From Igor Neyman
Subject Re: simple function index question
Date
Msg-id A76B25F2823E954C9E45E32FA49D70ECCD68075F@mail.corp.perceptron.com
Whole thread Raw
In response to Re: simple function index question  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: simple function index question
List 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

pgsql-sql by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: simple function index question
Next
From: Emi
Date:
Subject: query based on row number for psql8.3