🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1136

Mulit-column key and SELECT query

#1136
From: Tumurbaatar S.
Date: Fri, 21 Jan 2005 08:42
12 lines
1192 bytes
A table contains a primary key like this:

PRIMARY KEY (col1, col2,...colN)

And SELECT query like:

SELECT ... WHERE col1 op ? AND col2 op ? AND ... colN op ?

where "op" is some comparison operator (=,<>,>,<...).

Does MySQL use above key to optimize this query? Or I need
to create additional indexes on all fields except col1?
Technical Details
Message-ID: <41f0c07c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!hammer.uoregon.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,8bc0664be93587ea,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Tumurbaatar S." <nospam_tumur@magicnet.mn>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Mulit-column key and SELECT query
Date: Fri, 21 Jan 2005 16:42:34 +0800
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
NNTP-Posting-Host: 202.131.2.5
Message-ID: <41f0c07c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1106296956 202.131.2.5 (21 Jan 2005 00:42:36 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!hammer.uoregon.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail