Suthish Nair

Suthish Nair

  • NA
  • 30.5k
  • 7.2m

SQL Server Fun - 2

Feb 9 2011 5:23 AM

Hi,
Lets have some another SQL query fun.  This only for learning purpose, anyone can reply with their inputs. Here we go..

I was working on my project and one of the requirement was to show product wise report.

The product master is from an external SQL DB. So, the process i followed.


1. Creating DBLink and fetching the records from master SQL DB through View.

2. Joining this View with my tables and showing the report.

3. Its takes around 8 - 10 secs to show the output for just 500 rows.


So my question is what happening here, why its takes this much time.
SELECT * FROM mytable
SELECT * FROM view
Which will run faster from above sql statement. How will i optimize my query.
Note: I already done this now the query run much faster, but needs some inputs from all you people. :)


Answers (5)