Hello, I have a table with two indexes one on load_nbr (indexed as shipment_pk which is the primary key) and one on status code (Status_code_indx - non-unique). My query looks for all loads above a certain value where the status code is within a range. I would like the set returned in order of the shipment_pk primary key (load_nbr). Currently it returns in order of the status code index. I want to avoid using 'order by' because it takes 10 seconds where the query takes miliseconds without it (note: the returned set has thousands of records). Here is and example of the current query:
Select * from shipments where load_nbr>='KT-1234' and status_code>'S' and status_code<'Y'
Is there any expression I can use to return it by shipment_pk (use index(shipment_pk) for example)? I have tried various syntaxes with no luck. I'd appreciate any help you could offer!!
Thank You
Jax
Select * from shipments where load_nbr>='KT-1234' and status_code>'S' and status_code<'Y'
Is there any expression I can use to return it by shipment_pk (use index(shipment_pk) for example)? I have tried various syntaxes with no luck. I'd appreciate any help you could offer!!
Thank You
Jax