Re: [SQL] Multi ordered select and indexing

2004-04-29 Thread Tom Lane
"Antal Attila" <[EMAIL PROTECTED]> writes: > CREATE OPERATOR CLASS int4_reverse_order_ops > FOR TYPE int4 USING btree AS > OPERATOR1 /< , > OPERATOR2 /<= , > OPERATOR3 /= , > OPERATOR4 />= , >

Re: [SQL] Multi ordered select and indexing

2004-04-29 Thread Christoph Haller
Have you thought of using a functional index on both columns? Regards, Christoph > > Hi! > What is the simplest solution for this query type: > > SELECT * FROM tablename ORDER BY col1 ASC, col2 DESC; > > In our experience, postgres cannot use a multi-colum index on (col1, > col2) in t

[SQL] Multi ordered select and indexing

2004-04-26 Thread Antal Attila
Hi! What is the simplest solution for this query type: SELECT * FROM tablename ORDER BY col1 ASC, col2 DESC; In our experience, postgres cannot use a multi-colum index on (col1, col2) in this situation. Is custom operator class the easiest solution, which can solve the reverse indexing on

Re: [SQL] Multi ordered select and indexing

2004-04-23 Thread Bruno Wolff III
On Fri, Apr 23, 2004 at 16:33:14 +0200, Antal Attila <[EMAIL PROTECTED]> wrote: > > In our experience, postgres cannot use a multi-colum index on (col1, > col2) in this situation, becouse there are different directions after > ORDER BY. Is custom operator class the easiest solution, which can so

Re: [SQL] Multi ordered select and indexing

2004-04-23 Thread Stephan Szabo
On Fri, 23 Apr 2004, Antal Attila wrote: > Hi! > > We have a complex problematic area. What is the simplest solution for > the next query type: > > SELECT * FROM tablename ORDER BY col1 ASC, col2 DESC; > > In our experience, postgres cannot use a multi-colum index on (col1, > col2) in this situa

[SQL] Multi ordered select and indexing

2004-04-23 Thread Antal Attila
Hi! We have a complex problematic area. What is the simplest solution for the next query type: SELECT * FROM tablename ORDER BY col1 ASC, col2 DESC; In our experience, postgres cannot use a multi-colum index on (col1, col2) in this situation, becouse there are different directions after