Help on Indexes!

Help on Indexes!

Post by Adrian Harris » Sat, 16 Jan 1999 04:00:00



I have a table with 2 fields "ID, Name"

I want to be able to search on them both together & individually!

Do I have to create 3 indexes i.e on ID, Name, ID&Name or will just the one
ID&Name work?

Thanks

Adrian HArrison

 
 
 

Help on Indexes!

Post by RP Data Solutio » Sat, 16 Jan 1999 04:00:00


If you search them individually and it's not the field you defined
first in your create index statement, it will not be used.. try
creating one for each field and see how it goes..

Robert Prendin


>I have a table with 2 fields "ID, Name"

>I want to be able to search on them both together & individually!

>Do I have to create 3 indexes i.e on ID, Name, ID&Name or will just the one
>ID&Name work?

>Thanks

>Adrian HArrison

Robert Prendin
RP Data Solutions Inc.
Specializing in ORACLE DBA Support Services

 
 
 

Help on Indexes!

Post by cona » Sat, 16 Jan 1999 04:00:00



> >I want to be able to search on them both together & individually!

You can search all 3 ways by creating 2 indexes as follows

index1 on (col1,co2)
index2 on (col2)

any query on col1 should use index1 (optimizer aside)
any query on col2 will use index2
any query on both columns will use index1

Conan

 
 
 

Help on Indexes!

Post by fumi » Mon, 18 Jan 1999 04:00:00



Quote:>I have a table with 2 fields "ID, Name"
>I want to be able to search on them both together & individually!
>Do I have to create 3 indexes i.e on ID, Name, ID&Name or will just the one
>ID&Name work?

You can search all 3 ways by creating 2 indexes as follows

index1 on (col1,co2), index2 on (col2)
or just
index1 on (col1), index2 on (col2)

 
 
 

Help on Indexes!

Post by Connor McDonal » Tue, 19 Jan 1999 04:00:00



> I have a table with 2 fields "ID, Name"

> I want to be able to search on them both together & individually!

> Do I have to create 3 indexes i.e on ID, Name, ID&Name or will just the one
> ID&Name work?

> Thanks

> Adrian HArrison

(Largely) paraphrased...

An index on (id, name) will help
   a. queries on "id"
   b. queries on ( id, name)
   c. not queries on name

An index on each will help:
   a. queries on id
   b. queries on name
   c. queries on both (but not as well as the index above)

There are a lot of other dependencies on all of this being - format of
your SQL etc etc

Cheers
--
==============================================
Connor McDonald
BHP Information Technology
Perth, Western Australia
"The difference between me and a madman is that I am not mad"
                                - Salvador Dali

 
 
 

1. HELP: Using Index Server to Index SQL Server

Hi,

Apologies for cross-posting, but I'm getting desperate!

According to Microsoft, it is possible to have full text searches
performed on the contents of SQL Server 6.5 databases using Index Server
2.0 .

I kind of understand that it does this by duplicating the contents of
each record as a web page in a web, and the indexing the web pages using
as stored procedure withing SQL Server.

Is this correct?

If so, does anyone have any experience of doing this?
What is the file size comparison between the database and the created
web pages, e.g 50mb database=200mb of web pages?

If not, how does it work?

Any ideas anyone, or altenatively can anyone recommend a different tool
or method for accomplishing this.

Don't you just love easy questions?!

Thanks in advance for any input to this; I've trawled the web,
newgroups, press, everything and I can't seem to find any backup to
microsofts claim.

Cheers,

Mik Foggin
I*net Development
FI GROUP PLC

2. Multiple Reads Terminating

3. Need Help - 1505 Index Error

4. MCSE, CCNA, CCNP,CCIE, CCSA....etc trade on Oracle 9i or java2 exam material

5. HELP: words index in one field

6. Serial Fields

7. help with indexing strategy

8. Help with Indexes Migration Using DTS Import/Export

9. Help with indexes for sorting

10. Help - VarChar indexes

11. Help with Indexes

12. Need help med indexes