Turns out there's 1.5 million records... The SQL database is taking about 17-20 seconds to run the query. Would it be best to have Java handle the joins and rearranging in that case? Since this is a web app, if multiple users are getting Excel exports, would the long queries reduce the overall performance of the site?[/edit]
I have a dataset that contains roughly 70,000 records. For simplicity's sake, let's say the data currently looks like this:
User ID | Question | Answer
In our web application, the data needs to be rotated 90 degrees and exported into Excel, such that we have the following:
User ID | Question 1 | Question 2 | Question 3 ....
I think we end up with around 50 or so columns.
Should the data be rearranged on the database side using pivot tables or should it be rearranged on the application side? Which solution would be the easiest to maintain? Which solution would have the greatest performance?