on ‎2013 Jan 09 7:16 AM
After starting the database when the first query takes longer to run. For example, a simple query to get the date of the last sale, after this consultation the other run faster:
select max(date_sale) as data_sale from tbsales, tbsales_tribute where tbsales.emp = tbsales_tribute.emp and tbsales.sale = tbsales_tribute.sale and tbsales.emp = 1 and tbsales_tribute.type = 5
or
select max(date_sale) as data_sale from tbsales key join tbsales_tribute where tbsales.emp = 1 and tbsales_tribute.type = 5
or
select max (date_sale) as data_sale from tbsales join tbsales_tribute on (tbsales_tribute.emp = tbsales.emp and tbsales_tribute.sale = tbsales.sale) where tbsales.emp = 1 and tbsales_tribute.type = 5
Which of these queries is more optimized?
(a friend told me that we should always use the sybase key join instead of join, key join the reserved word always makes the query more optimized, so pe truth? where I can find material about?)
Request clarification before answering.
Hi,
Working with an ERP that features integration with Inventory, Sales, bank, cash, documents payable, receivable documents, accounting, tax paying employees. And every now and then is always showing signs of sluggishness in queries. Some here have suggested deleting some data (say the database is too "bloated"), but I do not think so because the databases have averaged about 3GBytes the 5GBytes, good servers, and I'm always trying to improve their performance through REORGANIZE TABLES, delete and create statistics, initializing the memory bank with larger cache and are already used the contig.exe to defragment the database file already ran the index consultant, but, the last time (about 1 month or less) back to slow again, the databases of customers are increasing, and now who never complained of are calling for technical support and "burning down". I do not know what else to do. Are already thinking about changing to DBMS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Walmir: As you post these general experiences, I guess you current performance-related questions are still unanswered. (Sorry, I don't have the skills to answer them.)
In case my observation is correct, I'd recommend to re-activate these questions, say by adding a comment...
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.