[QODBC ALL] - How to increase the update or delete SQL statement performance.
Posted by Rajendra Dewani (QODBC Support) on 15 November 2022 10:27 AM
|
|
[QODBC ALL] - How to increase the update or delete SQL statement performance.Problem Description:Ran this SQL to move an invoice from one Customer to another:
Solution:Please make sure Optimizer is enabled. - https://qodbc.com/links/2358 If you are executing an SQL statement for the first time on this table, QODBC has built the optimizer before processing the SQL statement. "Waiting on QuickBooks" may take longer than usual. Please run the SQL statement again, and if you are still facing the same issue, please try the following options.
Make use of the index fields such as TxnID or TxnDate to filter the number of records scanned. Update invoice set CustomerRefListID = '1500' where TxnID='ValueOfYourTxnID' or Update invoice set CustomerRefListID = '1500' where TxnDate>={d'2022-11-10'} and TxnDate<={d'2022-11-15'} and TxnNumber = 8453
If you are still facing the issue, please try using the UNOPTIMIZED keyword. Update invoice UNOPTIMIZED set CustomerRefListID = '1500' where TxnID='ValueOfYourTxnID'
Problem Description:We have low performance in SQL Server Linked Server using QREMOTE.
Solution:Please make sure Optimizer is enabled. - https://qodbc.com/links/2358
Update QREMOTE...customer set JobTitle = 'Job' where ListID='8000000F-1466614340'
When you use the above query, SQL Server will fetch all the data from the Customer table. SQL server will then apply the filter of List ID. SQL Server will generate an update statement from the derived result and send it to QODBC/QRemote. Thus, for a single record update, the entire table is scanned.
Please use the Index fields in the "select" and "update" clauses.
Note: Here, we are using ListID (the index field) in the select statement and the OpenQuery update statement.
If you are still facing the issue, please use the UNOPTIMIZED keyword. update openquery (QRemote, 'select ListID, JobTitle from Customer UNOPTIMIZED where ListID=''8000000F-1466614340''') set JobTitle = 'Job' where ListID='8000000F-1466614340'
| |
|