Hello Martin , so if I go with first suggestion of yours
If reading 30000 records from database takes half an hour, something is wrong with your query and multithreading won't fix it.
No , the reading of records from db is not taking more than 2 mins for a months data
You need to fix the query. I would quickly review the query (to make sure that all relations are set correctly, only the needed fields are returbned and indexes look more-or-less correct) and then looked at the execution plan to understand which part is so slow.
I have analysed for the indexes and we cannot have any unique index , non- clustered indexes we have already created , we are returning only those fields that are needed for further processing , what here do you mean by execution plan ? I'm not sure on this part please help how can I use it any documents ?
I too would like to hear answers to these questions of Nikolaos: "Does your report have 30 000 rows per day? And if user prints it for one month, it has one million records? How many pages is that? What is it needed for?"
Yes , unfortunately we have huge data and around 570 pages are getting printed for a months data.
In this report , we already have one more report (which gets called on condition if met) to export data into excel already
Code for it :
public void run()
{
c1 contract;
c2 cnlAs_ExcelExport (new SSRS report class with SRSReportDataProvideBase extension)
contract = this.parmReportContract().parmRdpContract() as c1;
cnlAs_ExcelExport = new c2();
if (contract.parmExportToExcel())
{
cnlAs_ExcelExport.parmQuery(this.getFirstQuery());
cnlAs_ExcelExport.exportToExcel(contract);
}
else
{
this.runReport();
}
}
Please let me know if the multi -threading is going to be the best possible option or anything else can be tried ?
The report is taking a lot of time and system gets hanged