![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a problem with one of my queries which is never finished within the timout. I've tried to optimize my query with indizes but without success. Here is the query: // use md; SELECT eval.eval_channel, eval.eval_math, eval.eval_value, eval.eval_ts, eval.eval_id, eval.stueck_id, stueck.los_id, los.los_nr, stueck.stueck_nr, eval.eval_name, eval.eval_type FROM ds_eval eval INNER JOIN ds_stueck stueck ON stueck.stueck_id=eval.stueck_id INNER JOIN ds_los los ON los.los_id=stueck.los_id INNER JOIN ds_aggregat aggregat ON aggregat.aggregat_id = los.aggregat_id INNER JOIN ds_betrieb betrieb ON betrieb.betrieb_id = aggregat.betrieb_id WHERE stueck.start BETWEEN 3403670984 AND 3403834990 AND betrieb.name = 'NRW' AND eval.eval_name IN ('NRW_STB_M2-Drehz_MIN-MAX-MEDIAN') ORDER BY los.los_nr, stueck.stueck_nr, eval.eval_name; // What else can I do to optimize. I think that the parts "WHERE stueck.start BETWEEN 3403670984 AND 3403834990" and 'eval.eval_name IN ('NRW_STB_M2-Drehz_MIN-MAX-MEDIAN')' are causing the problem. The execution plan says that the clustered index scan on the primary key of the table ds_eval costs 89%. Has anybody some hints? |
![]() |
| Thread Tools | |
| Display Modes | |
| |