Ticket T534420
Visible to All Users

SQL query executed multiple times

created 8 years ago (modified 8 years ago)

This query is executing multiple times using different values as params. It executes after new object is saved. In total it takes a few seconds to complete.

What is the query for? Is there a way to defer them?

-- Executed against JFBTSNPM12SQL55.colo.brandideas.com
USE [merlin_20170615]
DECLARE @p0 Int SET @p0 = 12
DECLARE @p1 NVarChar(4000) SET @p1 = '[Int32]''1'''

-- Executed query
select top 1 N0."Oid",N1."TargetType",N1."TargetKey",N1."OptimisticLockField",N1."GCRecord",N1."ObjectType",N0."GuidId",N0."IntId",N0."DisplayName" from ("dbo"."AuditedObjectWeakReference" N0
 inner join "dbo"."XPWeakReference" N1 on (N0."Oid" = N1."Oid"))
where (N1."GCRecord" is null and (N1."TargetType" = @p0) and (N1."TargetKey" = @p1))

Answers approved by DevExpress Support

created 8 years ago

Hello Rick.

This query is executed to find a weak reference created by the Audit Trail Module. I'm afraid this query cannot be avoided unless you refrain from using the module. If it takes too long to execute this query in the database, analyze the query execution plan to determine which operations are most expensive and why. Usually, adding an index for a few columns can help.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.