I'm sure !
In article <01bd8fd3$d744e590$17c8c8c8@saturno>,
"Rui Domingos" <rui.domingos@psidoc.pt> wrote:
>
> I think the optimizer takes care of that, but I'm not sure.
>
> Candy McCall <candym@olcinc.com> wrote in article
> <6l58c9$j8v$1@news.xmission.com>...
> >
> > This is a multi-part message in MIME format.
> >
> > ------=_NextPart_000_004F_01BD8F43.26C88C20
> > Content-Type: text/plain;
> > charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
> >
> > I have a simple question. Suppose you have a table whose primary key is
> =
> > a composite
> > key of the columns col1,col2,col3,col4 (primary key is in that order). =
> > If you do a query to=20
> > fetch a record by the primary key, does it matter what order you ask for
> =
> > the columns=20
> > in the where clause?
> >
> > For example, does =20
> > SELECT * FROM someTable WHERE col4=3D? AND col1=3D? AND
> > col2=3D? AND col3=3D? =20
> > get the record as efficiently as the statement
> > SELECT * FROM someTable WHERE col1=3D? AND col2=3D? AND col3=3D? AND> =
> > col4=3D?
> >
> > I always order the columns in the where clause in the order of the =
> > primary key or the
> > index I'd like the optimizer to use. I've noticed in the IBM Visual Age
> =
> > for Java that some
> > of the code generated to retrieve a row by a primary key may mix up the =
> > order.
> >
> > Thanks!
> >
> > Candy
> > --
> > Candy McCall
> > ONLINE Computing, Inc.
> > (candym@olcinc.com)
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading