Slow Query Needs Some Peppering

grovelli
4StarLounger
Posts: 528
Joined: 26 Jan 2010, 15:14

Slow Query Needs Some Peppering

Post by grovelli »

The ExportDataToExcelSQL query in the attached mdb runs fine but when I run it in the original db which has many more records, it takes 2 minutes to come up with the results. Any way to streamline the process?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78524
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Slow Query Needs Some Peppering

Post by HansV »

qCom1Energia, qCom2Energia, qPne1Energia and qPne2Energia are based on two tables, but they only use dbo_c_LetturaGiornalieraSTD. You should remove dbo_c_PrecipitazionEPortata from these queries.

If you do that, ExportDataToExcelSQL doesn't need to be a Totals query.
Best wishes,
Hans

grovelli
4StarLounger
Posts: 528
Joined: 26 Jan 2010, 15:14

Re: Slow Query Needs Some Peppering

Post by grovelli »

Thank you so much Hans