I have a table which contains two fields:
ProductCode
StockQuantity
Each day I have messages build up on a queue from an external source which simply contain a product code. I then have send a reply message with the product code and the quantity in stock. Nothing too tricky there.
The problem I have is there could be thousands of messages on the queue. What I want to avoid is having to run thousands of individual queries e.g SELECT productcode, stockquantity FROM stock WHERE productcode = '12345'; because I'm woried it will take too long.
What's the quickest way to achieve what I want? I thought if I read all the messages off the queue and created a temporary table to use on a JOIN?
ProductCode
StockQuantity
Each day I have messages build up on a queue from an external source which simply contain a product code. I then have send a reply message with the product code and the quantity in stock. Nothing too tricky there.
The problem I have is there could be thousands of messages on the queue. What I want to avoid is having to run thousands of individual queries e.g SELECT productcode, stockquantity FROM stock WHERE productcode = '12345'; because I'm woried it will take too long.
What's the quickest way to achieve what I want? I thought if I read all the messages off the queue and created a temporary table to use on a JOIN?