Steve Atkins wrote:

On Fri, Jun 10, 2005 at 01:45:05PM -0400, Clark Slater wrote:

Hi-

Would someone please enlighten me as
to why I'm not seeing a faster execution
time on the simple scenario below?

> [...]
>
Create an index on (productlistid, typeid, partnumber) then

  select * from test where productlistid=3 and typeid=9
   order by productlistid, typeid, partnumber LIMIT 15;


Clark, try also adding (just for testing) partnumber to your
where clause, like this:

   select * from test where productlistid=3 and typeid=9
   and partnumber='foo' order by productlistid,
   typeid, partnumber;

and check output of explain analyze.

I had experiences of planner "bad" use of indexes when attribute
types were integer and cardinality was low (a single attribute
value, like "typeid=9" selects one or few rows).
However, this was on 7.1.3, and probably is not relevant to your case.

--
Cosimo


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to