INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

SLOW QUERY

SLOW QUERY

(OP)
I'm trying to run the following query through excel VBA to an accpac 5.5 pervasive database:

CODE

SELECT ICITMV.VENDNUM, ICITMV.VENDNAME, ICILOC.ITEMNO, ICILOC.QTYONHAND, ICILOC.QTYONORDER, ICILOC.QTYSALORDR, ICILOC.QTYONHAND-ICILOC.QTYSALORDR AS NET_AVAIL,  ICSTATI.SALESQTY, ICSTATI.SALESQTY/365 AS DDD
FROM ICSTATI INNER JOIN (ICILOC INNER JOIN ICITMV ON ICILOC.ITEMNO = ICITMV.ITEMNO) ON ICSTATI.ITEMNO = ICITMV.ITEMNO
WHERE (((ICITMV.VENDNUM)='22280') AND ((ICSTATI.YEAR)='2008') AND ((ICSTATI.PERIOD)=10));

I get this when I run from Aqua Studio:
 60 record(s) selected [Fetch MetaData: 15/ms] [Fetch Data: 72407/ms]

 [Executed: 26/01/09 9:33:00 EST AM ] [Execution: 5141/ms]

Is there a way to make this faster ? Is the SQL badly built ?
 

RE: SLOW QUERY

Not knowing the database, I can't say if it's "bad" SQL or not.  It's possible that the indexes are not being used.  
Specifically, you'll want to check on:
ICITMV.VENDNUM
ICSTATI.YEAR
ICILOC.ITEMNO
ICITMV.ITEMNO

Make sure those are indexed.  
You could also use the Query Plan and Query Plan Viewer to see how the engine is processing the query.
 

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

RE: SLOW QUERY

(OP)
Thanks for the post :)

RE: SLOW QUERY

You're welcome. Thanks for the star. I hope you can resolve the slow performance.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close