Home > database >  Link the server of this view is not slow, the conditions for a table b table fields is not slow, but
Link the server of this view is not slow, the conditions for a table b table fields is not slow, but

Time:11-19

ALTER the VIEW [dbo] [LISITEM_to_others -]
AS
The SELECT Amy polumbo ATIENT_ID AS PATIENT_NO, a.O RDER_NO AS TEST_NO,
B. EEITEM_NAME AS SUBJECT, a.S AMPLE_TYPE,
A. d. IAGNOSE AS CLINIC_DIAG, a.S OURCE_DOCTOR AS REQUEST_DOCTOR,
A.O RDER_DATE AS REQUEST_DATE, a.t est_date AS EXECUTE_DATE, al-qeada ENDER,
A.A GE, a.A GE_UNIT, a.O RDER_NO,
Amy polumbo ATIENT_NAME AS PATIENT_NAME
, d. id number inside the as patient_id
The FROM dbo. TB_CURRENT_SAMPLE_INFO a
Left the join [192.168.0.2] hisdbsq. Dbo. His_To_Lis_PatInfo d on
(Amy polumbo ATIENT_ID=d. outpatient number or Amy polumbo ATIENT_ID=d. hospitalization)
INNER JOIN
Dbo. TB_CURRENT_SAMPLE_FEE b ON a.S AMPLE_NO=b.S AMPLE_NO AND
A.S AMPLE_DATE=b.S AMPLE_DATE AND
Anderson NSTRUMENT=b.I NSTRUMENT


WHERE Dr. ALIDATE_FLAG='2'

And a.S AMPLE_DATE & gt; 30
=GETDATE () -
And d. one cartoon internal number='20200523000 eh'

CodePudding user response:

Such as online!!!!!!!!!!

CodePudding user response:

Too many reasons, first check the d column index, if not, set up first,

CodePudding user response:

I direct the select * from [192.168.0.2] hisdbsq. Dbo. His_To_Lis_PatInfo where one cartoon internal number='20200523000 eh is not slow

CodePudding user response:

Amy polumbo ATIENT_ID=d. outpatient number or Amy polumbo ATIENT_ID=d. in the hospital, you don't have the or, with a condition of separate first try slow slow, premise is, of course, the index is built on the associated conditions,

CodePudding user response:

Also slowly, not the problem

CodePudding user response:

Look at the execution plan, and see where is slow, and then analysis and optimization,

CodePudding user response:

Just see the execution plan, according to the remote query overhead by 96%, I directly select * from [192.168.0.2] hisdbsq. Dbo. His_To_Lis_PatInfo where one cartoon internal number='20200523000 eh it also calculate remote query is not slow

CodePudding user response:

CodePudding user response:

refer to 7th floor w510172313 response:
just looked at the execution plan, according to the remote query overhead by 96%, I directly select * from [192.168.0.2] hisdbsq. Dbo. His_To_Lis_PatInfo where one cartoon internal number='20200523000 eh' 'it was remote query is not slow.


By itself, it can try the result set generated temporary table, then try the temporary table,

CodePudding user response:

Ok, exclude the right

CodePudding user response:

Get the result set generated a temporary table to the local library is not slow, how to solve this?
  • Related