Subject TimeStamp Index Question
Author Lee Jenkins
Hi all,

FB 2.1

I have a query that will be ordering a TimeStamp field descending. Is it
generally a good idea to place a descending index on a field like that? I would
assume that a Time Stamp would have fairly low selectivity, but I guess that
would depend on how many records are being inserted consistently...?

Thanks for input. The SQL is below for better understanding.

--
Warm Regards,

Lee


Query.SQLText :=
'SELECT ' +
' SALE.OID, ' +
' SALE.USER_OID, ' +
' SALE.CUSTOMER_OID, ' +
' SALE.SALE_ENTRY_TIME, ' +
' SALE.SALE_DEPART_TIME, ' +
' SALE.SALE_ENTRY_TIME, ' +
' POS_USER.USER_FIRST_NAME, ' +
' POS_USER.USER_LAST_NAME, ' +
' CUSTOMER.CUST_FIRST, ' +
' CUSTOMER.CUST_LAST ' +
'FROM ' +
' CUSTOMER ' +
' INNER JOIN ' +
' (POS_USER INNER JOIN SALE ON POS_USER.OID = ' +
' SALE.USER_OID) ON CUSTOMER.OID = SALE.CUSTOMER_OID ' +
'WHERE ' +
' SALE.DELIVERY_STATUS = :pDeliveryStatus ' +
'ORDER BY ' +
' SALE.SALE_DEPART_TIME DESC;';