[DUG] sql query issue

Leigh Wanstead leighw at softtech.co.nz
Fri May 9 09:38:24 NZST 2008


I think this is in general a sql server question. sql 2000 has a sql
enterprise manager/ studio which I can analyze sql query plan which you may
check which index you are using.

The step what I do is debug a normal sql query in sql query analyzer, once I
am happy, then I will put the code in store procedure

Have a nice day

Regards
Leigh
www.smootharm.com


-----Original Message-----
From: delphi-bounces at delphi.org.nz
[mailto:delphi-bounces at delphi.org.nz]On Behalf Of Neven MacEwan
Sent: Thursday, May 08, 2008 6:04 PM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] sql query issue


Vikas

Can you post the text of the query?

Basic Pointers

1/ Add indexes for ther foreign keys (these can allow duplicates)
2/ Restrict the result set (I assume you dont want the query to return
10 million rows)
3/ use ansi join syntax

N


> Hi
>
> I have an query related to an sql sever 200o using delphi 5. Not sure
> if this is the right palce to ask it. Still i belive may be soemone
> can help me in this
>
> I am creating a store procedure.
>
> In that i am fetching the information on the basis of join between two
> table.
>
> say table 1 and table2. Now thign is at my client place table 1 has 10
> million records and table 2 has 15 million records.
>
> Now i have done a join between these two table depending on
> tabl1.x=table2.x and table1.y=table2.y. I have used the primary key in
> colum x of table 1 that emans it automaticaly created a clustered
> idex. Now problem is when i execute this query it takes more than hour
> to run this query. Any way i can reduce the time of query using any
> option.i can't use primary keys on table2 sicne i do have duplicate
> values.
>
> Regards
> Vikas
> Solution consultant
> NCR coorporation
>
> --
>   vikas
> ------------------------------------------------------------------------
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe




More information about the Delphi mailing list