Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select and Indexes

Status
Not open for further replies.

aliiiish

Programmer
Dec 19, 2005
13
CA
Hi,

Assume we have the following:

CREATE TABLE test1 (
id integer,
content varchar
);

&

CREATE INDEX test1_id_index ON test1 (id);
CREATE INDEX test1_content_index ON test1 (content);

Which Select statement would perfom better?

1) SELECT content FROM test1 WHERE id = constant;
2) SELECT content FROM test1 WHERE id = constant; & content = constant
3) SELECT content & id FROM test1 WHERE id = constant & content = constant

Thanks..Ali
 
Was it a quiz? or you are not sure?

What are you selecting is not matters as I know and on which condition you are searching is important. I think all 3 will perform very well.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top