Re: [GENERAL] Indexes and sorting

2004-02-06 Thread David Garamond
John Siracusa wrote: SELECT * FROM t WHERE a = 1 AND b = 2 AND c = 3 ORDER BY b; Let's say the table just has one index: CREATE INDEX b_idx ON t (b); In this case, obviously the b_idx will be used and no sorting after the fact will be required. Now let's add an index: CREATE INDEX k

Re: [GENERAL] Indexes and sorting

2004-02-06 Thread Stephan Szabo
On Fri, 6 Feb 2004, John Siracusa wrote: > Are indexes useful for speeding up ORDER BY clauses? Example: > > CREATE TABLE t > ( > a INT, > b INT, > c INT, > d INT > ); > > SELECT * FROM t WHERE a = 1 AND b = 2 AND c = 3 ORDER BY b; > > Let's say the table j

[GENERAL] Indexes and sorting

2004-02-06 Thread John Siracusa
Are indexes useful for speeding up ORDER BY clauses? Example: CREATE TABLE t ( a INT, b INT, c INT, d INT ); SELECT * FROM t WHERE a = 1 AND b = 2 AND c = 3 ORDER BY b; Let's say the table just has one index: CREATE INDEX b_idx ON t (b); In this cas