I'm having a calendar feature developed whereby users can add recurring
events. These recurring events can have start and end dates, meaning they
will recur only within a date range. For instance, user A creates an event
that recurs every Tuesday, from 1/1/05 - 3/2/06.
The developer has decided that it would be good to have another table that
stores each individual recurring event in a separate record. His logic is
that this will help with the display of calendar months. His logic is, if
the application has to dynamically iterate through every event record in the
database and logically map out which days have recurrence, that it would not
be good for performance.
My take though, is that if one recurring event can literally add in 10,000
records, then that's even worse.
What are your thoughts on the proper way to implement this? 5 3881
Hi
It has always been hard to suggest for design issues,because you and only
you know exactly the business requrements.
CREATE TABLE Req_Events
(
EventId INT NOT NULL PRIMARY KEY,
UserId INT NOT NULL FOREIGN KEY ------Users Table,
StartDate DATETIME NOT NULL,
EndDate DATETIME NOT NULL -----you can create here a check constraints that
enddate must be less than startdate
)
"Shabam" <ch*****@yoma ma-nospam.com> wrote in message
news:Wf******** ************@ad elphia.com... I'm having a calendar feature developed whereby users can add recurring events. These recurring events can have start and end dates, meaning they will recur only within a date range. For instance, user A creates an
event that recurs every Tuesday, from 1/1/05 - 3/2/06.
The developer has decided that it would be good to have another table that stores each individual recurring event in a separate record. His logic is that this will help with the display of calendar months. His logic is, if the application has to dynamically iterate through every event record in
the database and logically map out which days have recurrence, that it would
not be good for performance.
My take though, is that if one recurring event can literally add in 10,000 records, then that's even worse.
What are your thoughts on the proper way to implement this?
Hi
From my perspective.
Create and entry for each occurrence in the main table, and link all the
occurrences together with an occurrence ID. This will enable the user to
remove a single occurrence (like an event that falls on a public holiday that
nobody would attend), without upsetting any logic. This may sound expensive,
but when you query for a specific user "Give me the events between today and
Sunday", it is a single query to a single table with a between operator. No
complicated logic to find out if there is a recurring event in the pile too.
An occurrence can also be changed. If a meeting moved from tomorrow onwards
to a new time, the old records for events that have occurred in the past
remain, and only the records dated tomorrow and later would be updated with
the new time. History can't change.
An occurrence is just a quick UI way for a user to do something that is
repetitive. It should not be handled in a different manner, compared to a
single event, in a DB just because of this. Separating Presentation and Data
logic.
Regards
Mike
"Shabam" wrote: I'm having a calendar feature developed whereby users can add recurring events. These recurring events can have start and end dates, meaning they will recur only within a date range. For instance, user A creates an event that recurs every Tuesday, from 1/1/05 - 3/2/06.
The developer has decided that it would be good to have another table that stores each individual recurring event in a separate record. His logic is that this will help with the display of calendar months. His logic is, if the application has to dynamically iterate through every event record in the database and logically map out which days have recurrence, that it would not be good for performance.
My take though, is that if one recurring event can literally add in 10,000 records, then that's even worse.
What are your thoughts on the proper way to implement this?
> From my perspective. Create and entry for each occurrence in the main table, and link all the occurrences together with an occurrence ID. This will enable the user to remove a single occurrence (like an event that falls on a public holiday
that nobody would attend), without upsetting any logic. This may sound
expensive, but when you query for a specific user "Give me the events between today
and Sunday", it is a single query to a single table with a between operator.
No complicated logic to find out if there is a recurring event in the pile
too. An occurrence can also be changed. If a meeting moved from tomorrow
onwards to a new time, the old records for events that have occurred in the past remain, and only the records dated tomorrow and later would be updated
with the new time. History can't change.
An occurrence is just a quick UI way for a user to do something that is repetitive. It should not be handled in a different manner, compared to a single event, in a DB just because of this. Separating Presentation and
Data logic.
Sounds fine, but what the system will allow many users to set up their own
calendars. If a user sets up an event that literally has 1000 individual
recurrences, then it won't take many users to bloat the database to an
unacceptable level wouldn't it? Also, the thought of a user clicking a
single button that generates 1000 records just doesn't seem right to me.
sp_msforeachdb 'EXEC sp_helpfile'
Note that sp_msforeachdb is not documented, not supported etc. Also, if you don't like the result
structure, you can easily change that by taking the source for from sp_helpfile and write your own
version that presents the information in a way that you like it.
--
Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/
"Shabam" <ch*****@yoma ma-nospam.com> wrote in message news:Wf******** ************@ad elphia.com... I'm having a calendar feature developed whereby users can add recurring events. These recurring events can have start and end dates, meaning they will recur only within a date range. For instance, user A creates an event that recurs every Tuesday, from 1/1/05 - 3/2/06.
The developer has decided that it would be good to have another table that stores each individual recurring event in a separate record. His logic is that this will help with the display of calendar months. His logic is, if the application has to dynamically iterate through every event record in the database and logically map out which days have recurrence, that it would not be good for performance.
My take though, is that if one recurring event can literally add in 10,000 records, then that's even worse.
What are your thoughts on the proper way to implement this?
Oops. Replied to wrong thread. Please ignore.
--
Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/
"Tibor Karaszi" <ti************ *************** @hotmail.nomail .com> wrote in message
news:e1******** ******@TK2MSFTN GP09.phx.gbl... sp_msforeachdb 'EXEC sp_helpfile'
Note that sp_msforeachdb is not documented, not supported etc. Also, if you don't like the result structure, you can easily change that by taking the source for from sp_helpfile and write your own version that presents the information in a way that you like it.
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/
"Shabam" <ch*****@yoma ma-nospam.com> wrote in message news:Wf******** ************@ad elphia.com... I'm having a calendar feature developed whereby users can add recurring events. These recurring events can have start and end dates, meaning they will recur only within a date range. For instance, user A creates an event that recurs every Tuesday, from 1/1/05 - 3/2/06.
The developer has decided that it would be good to have another table that stores each individual recurring event in a separate record. His logic is that this will help with the display of calendar months. His logic is, if the application has to dynamically iterate through every event record in the database and logically map out which days have recurrence, that it would not be good for performance.
My take though, is that if one recurring event can literally add in 10,000 records, then that's even worse.
What are your thoughts on the proper way to implement this?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Wm |
last post by:
I have a client who needs a good web-based calendar for their website. What
they would like is something that can display a monthly calendar online,
with a display that's large enough that you can see the events listed in
each day's box. (i.e., not just a numerical calendar but one where the event
time and title appear in the monthly view, like when you print a monthly
calendar from M$ Outlook.) They want to be able to easily edit it...
|
by: Shyguy |
last post by:
Is it possible to create a calendar that shows previous input data and
also allows for input of new data?
|
by: Chuck Van Den Corput |
last post by:
In one of my apps, I developed a calendar report composed of a 6x7
grid of subreports, one for each potential day in a month (the worst
case scenario is that a month spans 6 weeks, like July 2005).
The report logic works fine and the report can be printed when the
front-end and back-end both reside on my hard drive. In a live
environment however, when the back-end resides on a network drive, the
report doesn't get printed. It *appears*...
|
by: Shabam |
last post by:
I'm having a calendar feature developed whereby users can add recurring
events. These recurring events can have start and end dates, meaning they
will recur only within a date range. For instance, user A creates an event
that recurs every Tuesday, from 1/1/05 - 3/2/06.
The developer has decided that it would be good to have another table that
stores each individual recurring event in a separate record. His logic is
that this will help...
|
by: George Sexton |
last post by:
We're in the process of re-launching our web calendar product. We would
like to get your opinions on a couple of things about our site and
product.
This is a relaunch of an existing product with hundreds of customers. The
major effort of the re-launch is to focus more on the hosted calendar
market. Toward that end, we've re-designed our web site, and changed our
pricing. Essentially, we've dropped the license fee that we were charging...
| |
by: larry |
last post by:
I am in the process of rewriting one of my first PHP scripts, an event
calendar, and wanted to share the code that is the core of the new
calendar. My current/previous calendar processed data dates only, this
code is intended to use more thrifty event descriptions (3rd saturday,
last tuesday, etc.) as well as traditional one-of dates.
The core here here is quite spartan, no table logic or or db cruft
included (I figure you have our own...
|
by: ITistic |
last post by:
I am in the planning stages of a new web application. One of the
requirements for this application is to provide a Google Calendar type
interface to show important events which will be pulled from the
application's internal database, as well as provide a means for users
to create, edit, and delete their own custom events (including
recurring events). I have briefly looked into integrating Google
Calendar with this application. I've run...
|
by: swethak |
last post by:
Hi,
I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
|
by: swethak |
last post by:
hi,
i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i have to made in my code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |