We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

SQLAnywhere Performance Problem

lizm
lizm asked
on
Medium Priority
452 Views
Last Modified: 2008-02-01
We have an application that has been live for the past 4 months.  Last month creating invoice records (getting arrears, Debits and Credits) took 5 hours to run.  This month the same program took 40 Hours (Yes that is forty!!) to run.  Invoice records consist of two files, header and detail.  The header file contains from 4000 - 4500 records and the detail consists of 2-3 times as many records.  There were no changes to any of these programs in the past month.  The only thing I add were two view over the detail records to capture tax and usage records.  The header record has 3 views over it and the detail has the two new views previously described.  If anyone can help with this I would greatly appreciate it.  if you need any more information please let me know.

Thanks for any response ahead of time!!
Comment
Watch Question

Commented:
It sounds like you need to update your index statistics.

Do this by running update statistics on your tables such as

update statistics invoice_header

If you are using stored procedures you should have them recompiled by running sp_recompile in your tables

sp_recompile invoice_header

This will recompile all procs that use invoice_header.

This should fix your problem assuming you have CORRECT indexes on your tables.  If you don't then that is your problem.  This is not a big database and should not take that long to do anything.

Author

Commented:
I have looked for the UPDATE STATISTICS command, but I cannot find it.  I am using Sybase SQLAnywhere 5.5.  Perhaps I am not looking in the correct place.  Could this command be run in ISQL.  I tried it and it returned an error.  Could you please clarify your answer.

Commented:
Do you have any indexes on header_id for both the header and detail table?

 I'm sorry about the other reponse, it works on Sybase databases but not SQL Anywhere.

Author

Commented:
I do not have any indexes connecting the two.  The program that is running so slow is simply reading through the header and checking for any outstanding A/R or Credits for each account in the header.  If any are found, these are added to detail.  At first I thought my problem was due to the fact that A/R Detail and Payment Detail had gotten so large, but posting to these files has not slowed down,so I don't think that is the problem.  Do you think putting an index would help in this situation.

I would like to thank you for your help, and I am sorry that I did not answer this sooner, but I was out of town yesterday.

Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
if the answer doesnt solve your problem please reject it
have you tried dbunload and reload of your db file?

Author

Commented:
Your answer is correct.  I had a problem with indexes, but it was something the application I use calls virtuals.  The application does an automatic join on two files to bring in the virtuals.  I removed these virtuals, so in effect, I removed an index and my problem is solved.  Thanks for all your help.  I am sorry I did not respond sooner, I did not realise there was an update.  I did not receive any email showing there had been an update,(or I overlooked it).

I am from South Louisiana.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.