cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

wt.occurrence.StandardOccurrenceService.isUniqueOrDeleted()這個API會觸發select count(*)語句是必要的,造成 Database很大的 Loading

wt.occurrence.StandardOccurrenceService.isUniqueOrDeleted()這個API會觸發select count(*)語句是必要的,造成 Database很大的 Loading

wt.occurrence.StandardOccurrenceService.isUniqueOrDeleted()這個API會觸發select count(*)語句是必要的

3 Comments
BrentLi
18-Opal

[Translated to English]

wt.occurrence.StandardOccurrenceService.isUniqueOrDeleted() triggers the "select count(*) ..." SQL statement. Invoking the API in a loop will trigger a lot of "select count(*) ..." SQL statements in a short period. This results in the high DB CPU usage ratio and has the negative impact for the DB server.

Is it possible to not trigger the "select count(*) ..." SQL statement when invoking wt.occurrence.StandardOccurrenceService.isUniqueOrDeleted()?

毓謝
4-Participant

if the sql script don't use 
 SELECT COUNT(*) FROM PartUsesOccurrence A0 WHERE ((A0.usesOccurrenceDataIdentifier = @P0))

Change to

IF EXISTS (SELECT idA2A2 FROM PartUsesOccurrence  WHERE (usesOccurrenceDataIdentifier=@P0))

PRINT 'EXIST'

ELSE

PRINT 'NOT EXIST'

GO

 

This is a good way to solve this problem, but I don't know how to change this script.

 

olivierlp
Community Manager
Status changed to: Archived

Hello,

We are archiving your idea as part of a general review. This action is based on the age of your idea and the total number of votes received, as per this announcement.

You can always post a new idea with all the details required in the form.

Thank you for your participation.