I have a table in place with less than 50,000 records, which tracks the movement of various shipments.
Each shipment is assigned a tracking number.
Each shipment will then go through a series of 'workflows' when it reaches a certain point. There are a little over 10 workflows that a single shipment can go through. Some workflows may get skipped depending on the situation, but every shipment will have a beginning workflow and an ending workflow.
The table is set to track each shipment as it moves through the different workflows, thus saving the history of the workflows. With that said, the table will save over 10 records of the same shipment as it moves through each workflow.
They may look like duplicates, but they are not because the workflow and datestamps will be different.
Now, when a user runs a search for a particular group of shipments coming out of a particular area, the query takes so long to bring back the records. When I say 'so long', I mean it can take well over 30 seconds to a minute.
The primary keys are set to the tracking number, name of the shipper, the delivery location, but not the workflow.
I know this is not much to work with, but off top, how would I go about indexing a table like this?
I was trying to add a view of the table, but I could not figure out how to display it here.