Forum Replies Created

Viewing 7 posts - 1 through 8 (of 8 total)

  • RE: Improve Performance for a View

    I'm not sure how else to post it, so here is the plan in XML format.

    <?xml version="1.0" encoding="utf-16"?>

    <ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.1.1" Build="10.0.5512.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">

    <BatchSequence>

    <Batch>

    ...

  • RE: Improve Performance for a View

    I modified the query to select just the past two (2) weeks, and it sped up significantly. I welcome any other performance enhancement suggestions, but this may have solved the...

  • RE: Improve Performance for a View

    ScottPletcher (11/19/2014)


    Probably the big thing is to reduce all the gyrations around UnitLog. Please try the query below. If you tend to restrict UnitLog rows using fldDateTime range,...

  • RE: Improve Performance for a View

    Your original code used datetime to determine the "last" row. Indeed, it went to the trouble of a separate subquery to insure that datetime was determinate instead of RCN.

    You...

  • RE: Improve Performance for a View

    ScottPletcher (11/19/2014)


    Didn't see the test data when initially coding. I had to add RCN to the ORDER BY in case there are duplicate times ... although it seems odd/counterintuitive...

  • RE: Improve Performance for a View

    Here are the insert statements:

    INSERT INTO dbo.UnitLog (RCN, UnitNumber, UnitStatus, fldDateTime, CCNo, CommCenter) VALUES

    ('1','373','10-41','2014-11-07 15:59:00.0000000','2014-000057','20'),

    ('2','373','10-17','2014-11-07 16:59:00.0000000','2014-000057','20'),

    ('3','373','10-23','2014-11-07 17:09:00.0000000','2014-000057','20'),

    ('4','373','LOG','2014-11-07 17:19:00.0000000','2014-000057','20'),

    ('5','374','10-8','2014-11-07 15:59:00.0000000','2014-000059','20'),

    ('6','374','10-17','2014-11-07 19:49:00.0000000','2014-000060','20'),

    ('7','374','10-23','2014-11-07 19:59:00.0000000','2014-000060','20'),

    ('8','374','10-17','2014-11-07 20:04:00.0000000','2014-000061','20'),

    ('9','374','10-7','2014-11-07 20:19:00.0000000','2014-000061','20'),

    ('10','371','10-8','2014-11-07 11:29:00.0000000','2014-000055','20'),

    ('11','371','10-42','2014-11-07 11:59:00.0000000','','20'),

    ('12','372','10-23','2014-11-07 12:59:00.0000000','2014-000056','20'),

    ('13','372','LOG','2014-11-07 13:59:00.0000000','2014-000056','20'),

    ('14','372','10-8','2014-11-07 15:59:00.0000000''2014-000056',,'20'),

    ('15','372','10-7','2014-11-07 15:59:00.0000000','','20')

    GO

    INSERT INTO...

  • RE: Improve Performance for a View

    Thanks for the reply, and I apologize, I did not understand the use of the IfCode Shortcuts before. I will try to provide the information as best as I can....

Viewing 7 posts - 1 through 8 (of 8 total)