I am fetching data from a table having 20K row from a third-party source where the way of filling the table can't be changed table.
On the third party, the table is filled as following
- New data is coming at every 15 seconds approx 7K rows.
- At any given time only the last three timestamps will be available rest data will be deleted.
- No index on the table is there. Neither it can be requested due to unavoidable reasons and might be slowness in the insert.
I am aware of the following
- Row locks and up the hierarchy other locks are being taken while data insert.
- The problem persists with select with NO LOCK.
- There is no Join with any other table while fetching as we are joining the tables when data is at the local with us in the temp table.
- When the data insertion is stopped at the third party the data comes in 100ms to 122ms.
- When service is on it takes 3 to 5 seconds.
Any help/suggestion/approach is appreciated in advance.