This is a migrated thread and some comments may be shown as answers.

Optimized Query Select statement question

1 Answer 33 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sompop
Top achievements
Rank 1
Sompop asked on 31 May 2012, 04:59 PM
Hi,

From the example on this page http://demos.telerik.com/aspnet-ajax/scheduler/examples/optimizedqueries/defaultcs.aspx# 

SELECT * FROM [Appointments] WHERE ([Start] < @RangeEnd AND [End] > @RangeStart) OR ([RecurrenceRule] <> '') OR ([RecurrenceParentID] IS NOT NULL) 

I see that the select statement retrieved recurring events events using [RecurrenceRule] <> '' which is good. My question is why do you need the "OR ([RecurrenceParentID] IS NOT NULL)" ? From what I understand, an appointment has RecurrenceParentID only when it's modified from a recurring series and then a new row in Appointments table will be created. The first where clause (start < @rangeEnd...) should already retrieve those in the visible start/end. If you include the RecurrenceParentID IS NOT NULL wouldn't that unnecessary retrieve more appointments than needed?

Thanks
 

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 01 Jun 2012, 01:48 PM
Hi Sompop,

 
This statement is set because those appointments that are recurrent and the Master appointment starts before the visible range and their occurrences or exceptions are part of the visible range. If they are not loaded some appointments may not be loaded event though they should be.

Hope this will explain the issue.

All the best,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Sompop
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or