Vincent, > SELECT * FROM TABLE1 ORDER BY X DESC, Y ASC; > > (X is a date and Y a varchar) > > What would that index be? > > Is there a function I can use, to invert x (the date), so that I can > make a query / index set like :
PostgreSQL's sorting mechanism can use an index either ascending or descending; it does not make a difference. However, most of the time ORDER BY does not use an index at all because a seq scan is faster. Usually, ORDER BY uses an index only when combined with related criteria and/or the LIMIT clause. -Josh Berkus ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]