sql server - SQL query takes much time to execute -
I have a table I want to get a report in which I want to get the personalized candidate of each employee in a period of 7 days .. I have performed the following queries for this. Select to but it takes about 2 minutes to execute the above query .. I do not index indexing in the How to implement this query a few seconds ..? Based on your description of the problem , The query should look like this: (It believes that for this query The best index is a cover index in which there are three columns outlined in the query: candidates 43,437 rows with data, which are created by many employees
E, E.Employinaame, (Candidate Select from C to count (CID) where CRITID = E. ID and C. Sorted between convert (date time, 19/07 / 2014 ', 103) and Convert (date time, from '26 employees
E.ID employee's ID
employee Table <.. / P>
candidate Did.
Select Maker_ID, count (CID) Candidate convert from C here (Datetime, 1 9/07/2014 ', 103) and Convert (Datetime, '26 Creator / ID
candidate.Creator_id and
Employees.id Between are a foreign key relationship.)
create idx_candidate_createddate_creator_id_id index on candidate (created_date, manufacturer_id, id);
Comments
Post a Comment