indexes multicolumn - Mailing list pgsql-novice

From Jean-Yves F. Barbier
Subject indexes multicolumn
Date
Msg-id 20110531151842.54532304@anubis.defcon1
Whole thread Raw
Responses Re: indexes multicolumn
List pgsql-novice
Hi list,

as the doc says:

SELECT name FROM test2 WHERE major = constant AND minor = constant;

then it might be appropriate to define an index on the columns major and minor
together, e.g.:

CREATE INDEX test2_mm_idx ON test2 (major, minor);

I may ask a dumb question, but does the query planner also use such an
index with the inversed query, e.g.:

SELECT name FROM test2 WHERE minor = constant AND major = constant;

or am I obliged to define an inversed index?

JY
--
Everybody is going somewhere!!  It's probably a garage sale or a
disaster Movie!!

pgsql-novice by date:

Previous
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: strange SSL msg [SOLVED]
Next
From: Michael Wood
Date:
Subject: Re: indexes multicolumn