Solved

SQLAnywhere Performance Problem

Posted on 1998-08-05
7
427 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!!
0
Comment
Question by:lizm
  • 3
  • 3
7 Comments
 
LVL 3

Expert Comment

by:gmoriak
ID: 1098180
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.

0
 

Author Comment

by:lizm
ID: 1098181
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.
0
 
LVL 3

Expert Comment

by:gmoriak
ID: 1098182
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.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:lizm
ID: 1098183
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.

0
 
LVL 3

Accepted Solution

by:
gmoriak earned 100 total points
ID: 1098184
If figuring out if there is outstanding A/R or a credit for a header requires reading detail, then adding an index absolutely will help.  Not knowing your table layout, but guessing from past experience - you should add an index to invoice_header on header_id and add on to invoice_detail on header_id

If you figure out A/R or credit just based on a column in invoice header, then you should put an index on that column so they can be found immediately without scanning the table.

If you don't have any indexes, then I'm sure your application could be made to run much, much, much faster by tuning the database with correct indexes.  However, wrong indexes can be worse than not having any at all.

Where are you from?
0
 
LVL 1

Expert Comment

by:spacebrain
ID: 1098185
if the answer doesnt solve your problem please reject it
have you tried dbunload and reload of your db file?
0
 

Author Comment

by:lizm
ID: 1098186
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.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now