September 23, 2006 at 6:16 am
Hi,
i have a question.
If
I have a DB .
The DB has a table.
The table has records.
Now, i triggered a SQL query.
this results lots of records to be displayed
this will consume lot of time.
how can i save time ?
September 23, 2006 at 6:52 am
can i get some help ?
i think all the DB gurus are here...can you guys give me some tips ?
is my question understandable ?
September 23, 2006 at 8:30 am
are u trying to run a query and it takes longer? Do u want to speed up the query?
September 23, 2006 at 12:49 pm
Some generics:
Select the least amount of data you need.
Check your query plan (sql query analyzer ->display estimated execution plan)
Try to avoid cursors and work out a set-based solution.
Try to normalize the database.
A wellplaced index may improve query speed as well.
September 25, 2006 at 1:17 am
yes, sreejith
query takes longer time.
how do i speed up ?
September 25, 2006 at 1:20 am
Nothing understood.
can you please tell me the steps for MS SQL server 2000
September 25, 2006 at 3:46 am
Without wanting to sound harsh, I'd suggest that the first steps towards query tuning must be to learn how to use TSQL and understand the query plans that get generated.
You either need to put in the work required to learn it, or look at getting some consultancy from someone that has.
September 25, 2006 at 4:05 am
if you know , can you kindly please tell me OR forward me the relevant links how to do it .
do i need to create an index for the column ?
do i need to chnage the SQL query ?
Anyway,
If you know please forward me a relevant link where i find a lesson how to resolve this kind of things.
September 25, 2006 at 4:10 am
>Check your query plan (sql query analyzer ->display estimated >execution plan)
you told query plan
like this ?
http://en.wikipedia.org/wiki/Image:SQLServer_QueryPlan.png
but what can i do with this ? how it help to find a resolution ?
September 25, 2006 at 4:20 am
Yes, that's exactly what I mean, you can enable this setting in query analyser by clicking on the Query menu and selecting show execution plan, you can also do it by pressing CTRL+K.
As for understanding how they work, i'd suggest that you look through the articles on this site regarding indexing and performance tuning as a place to start. If you really need help immediately then I don't mind spending 5 minutes looking at the query plan that gets generated to see if I can spot anything untoward for you, just send me PM with the details/screenshot.
I wouldnt normally do this but I don't mind as a one off.
September 25, 2006 at 4:30 am
i see they are providing statistics of cost 1 % , 16 % etc etc.
so, as a primary guess , it seems in-effectively you shall be targetting to reduce this cost ?
and if we really want to reduce this cost then , i think we will have 2 options
(i) change the SQL query ( which is meaningless ...because i cant chnage the query )
(ii) do some tweak in the DB so that some magical thing happens and DB gives back fast response for this query .
this inferences i have drawn from my common sense.....let me know whats the real solution ....how people resolve it ?
September 25, 2006 at 4:32 am
i am trying to learn ...hope you guys help me.
September 25, 2006 at 4:50 am
We can't provide any help unless you post the execution plan on the site. It's like trying to show you how to go somewhere and you don't tell us where you want to go!!
Show us the map and we'll show you the way.!
September 25, 2006 at 4:54 am
i dont have it .
but i am trying to learn this concept so that if i fall in this same situation i can resolve it.
I am learning.
so, an example would be enough for me.
September 25, 2006 at 6:21 am
There's no exemple I can think of that couldn't be read on performance tuning articles. You'll have to look there or send us the exact query plan. We can't just start listing all the things you can do to optimize one query. The year is not long enough.
Viewing 15 posts - 1 through 15 (of 30 total)
You must be logged in to reply to this topic. Login to reply