Minimize
02

Is TOAD faster than BIDS Query Builder?

I had a question from the client the other day that confused me at first so I thought it would be good to post here.

The client had a query that looked like this:

SELECT

WH_PROJECT_LITI.PROJECT_NAME AS MNAME

, WH_PROJECT_LITI.PROJECT_NUMBER AS MNUMBER

, WH_PROJECT_LITI.MAIN_ASSIGNEE_NAME

, WH_CF_LITI.LIDISPOSITIONTYPE AS DISPOSITION

, WH_CF_LITI.LIDISPDATE AS DISPDATE

, WH_CF_LITI.LISETTLEAMT AS SETTLEAMNT

, WH_CF_LITI.LIMATTDESC AS MDESC

, WH_CF_LITI.LIDISPDESC AS "Disp Desc"

FROM WH_PROJECT_LITI, WH_CF_LITI

WHERE

WH_PROJECT_LITI.PROJECT_PRIMARY_KEY = WH_CF_LITI.PROJECT_ID

AND (WH_CF_LITI.LIDISPOSITIONTYPE = 'Settlement')

AND (WH_CF_LITI.LIDISPDATE >= TO_DATE('01/01/2010', 'mm/dd/yyyy'))

 

In TOAD on the clients machine this query finished in 109ms.  He complained that in BIDS Query Builder it finished in over 25 seconds.  The client thought that BIDS was much slower.

I ran the same query from my machine and it finish in TOAD at about the same speed as in BIDS.  I did not actual measure it because it seems almost instantaneous.

Realizing that the client was accessing a database that was remote to his location and my test was local to my location and after taking a closer look at the query results in TOAD I realized what was going on.

The results from TOAD look like this…

 

The results from Query Designer look like this…

 

Notice that last two fields in TOAD are reported as (CLOB) Character Large Objects and that the data is not actually returned.  In query designer it actually retrieved that data.

Because they are CLOB data types what comes back from the initial query is pointers to the data and additional calls from the client must be made to get the data.  Remember the client with the problem was going over the WAN which means the latency was much longer for him than me.

I profiled the two columns and neither has a length greater than 2000 characters.  So I told him to replace the query with:

SELECT

WH_PROJECT_LITI.PROJECT_NAME AS MNAME

, WH_PROJECT_LITI.PROJECT_NUMBER AS MNUMBER

, WH_PROJECT_LITI.MAIN_ASSIGNEE_NAME

, WH_CF_LITI.LIDISPOSITIONTYPE AS DISPOSITION

, WH_CF_LITI.LIDISPDATE AS DISPDATE

, WH_CF_LITI.LISETTLEAMT AS SETTLEAMNT

, CAST (SUBSTR(WH_CF_LITI.LIMATTDESC,1,4000) AS VARCHAR2(4000)) AS MDESC

, CAST(SUBSTR(WH_CF_LITI.LIDISPDESC,1,4000) AS VARCHAR2(4000)) AS "Disp Desc"

FROM WH_PROJECT_LITI, WH_CF_LITI

   WHERE

WH_PROJECT_LITI.PROJECT_PRIMARY_KEY = WH_CF_LITI.PROJECT_ID

AND (WH_CF_LITI.LIDISPOSITIONTYPE = 'Settlement')

AND (WH_CF_LITI.LIDISPDATE >= TO_DATE('01/01/2010', 'mm/dd/yyyy'))

 

I actually measured the difference on my laptop the original query ran 441ms and the modified one ran in 10ms (97% improvement).  

 I guess the moral of the story is everything isn’t what it seems and replace CLOB objects with VARCHAR2 (if you don’t really need the size) so you don’t have these hidden calls on the network.

Comments

Anonymous User
# Anonymous User
Saturday, October 02, 2010 4:58 PM
Is BIDS slow compared to TOAD when executing a query?

Post Comment

Only registered users may post comments.

LatestArticles Minimize
Changing Granularity of Leaf Level Calculations in SSAS Tabular by Jason Thomas

Finding Nearest Stores using SSRS Map Reports by Jason Thomas

Heat Maps for SSRS using Map Control by Jason Thomas

Parameters for Analysis Services Reporting: Introduction, Pt. 3 by William Pearson
BI Architect Bill Pearson continues an extended examination of parameterization within Analysis Services reports. In this, Part 3 of the article, we continue to get hands-on practice cr...

Parameters for Analysis Services Reporting: Introduction, Pt. 2 by William Pearson
BI Architect Bill Pearson continues an extended examination of parameterization within Analysis Services reports. In this, Part 2 of the article, we continue to get hands-on practice cr...

Using Annotation Tables in SSAS to Show Last Processed Time and Latest Data Updates as a Measure in a Cube by John Hall

Using Color in SSRS Charts by Melissa Coates
Effective data presentation techniques help users  interpret information quickly and reliably.  Layout, formatting, sizing, labeling, and other report elements may all be used to facilitate ...

Is TOAD faster than BIDS Query Builder? by John Hall

SSRS: Unexplained Warning “This field is missing from the returned result set from the data source” And Checking a Field for Null Exception by John Hall
If you ever see the warning message “This field is missing from the returned result set form the data source” and get unexplained #Errors in columns on your report it may be from SSAS not returning a ...

Beyond Excel pivot tables: Leveraging cube formulas with MDX by Javier Guillen
PowerPivot and DAX are a powerful technologies, but there is still a good amount of work that can be done with traditional cube functions. In its current version, PowerPivot lacks the concept of ...


Advertisement Minimize

Advertisement Minimize

Copyright 2004-2012 MSBICentral.com Terms Of Use Privacy Statement