Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql statement takes too long non-optimesed

Status
Not open for further replies.

KoenPiller

Programmer
Apr 4, 2001
270
0
0
NL
Hi,
I cant get this select statement optimized, it takes too long:

Code:
Select myCursor.productnmr, ;
       myCursor.startingdate, ;
       sum(myCursor.productive) as productive ;
  from myCursor ;
  join products on products.productnmr = myCursor.productnmr ;
 where myCursor.startingdate between(product.startingdate and product.endingdate) ;
  into cursor curProductiveactive

Nb products has an index on startingdate, endingdate and productnmr

Just hope on someone around who could help me with this one.

Thanks,

Koen
 

Olaf,

I believe the tables were created in VFP 8.0, but I'm not sure. But I don't see why it is relevant.

Whatever changes have taken place in index or table structures between versions, that has nothing to do with my original assertion: that WHERE and JOIN are identical, performance-wise.


Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top