Storing that many variables for each process instance is not a good idea, it'll lead to some poor performance.
I'd guess optimizing the db + query is the first thing to try.
Turning off history and listen to events, as Martin suggests, is surely an option, but a heavy one. I would first try to optimize the process, try to store way less data and try to optimize the query (indices maybe?)