Code
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.
Code
SELECT * FROM mytable
SELECT * FROM viewNote: I already done this now the query run much faster, but needs some inputs from all you people. :)


Suthish NairRank #92 · 22.8K reputationPosted Feb 9, 2011, 10:45 AM EST
If you dont like the post say it, like that we can start the disucssion :)
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 9, 2011, 10:07 PM EST
I'm not doing much DB work but still i like to participate...
If you are using views then it should reduce the time and if you want to create a view and it should be reasonable like.. if there is join takes place very frequently then you can create a view for it.. and in this case your View will run faster then your Join.
If we talk about the query optimization then you can evaluate your query by analyzing the data you are filtering, joining with. The change in order of statements of filter and join will also increase the performance.
:))
Suthish NairRank #92 · 22.8K reputationPosted Feb 9, 2011, 10:20 PM EST
But if we convert that View to Table then its works so fast.
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 10, 2011, 1:27 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 10, 2011, 1:59 AM EST