Showing posts with label advise. Show all posts
Showing posts with label advise. Show all posts

Wednesday, March 21, 2012

Please Advise: Big Control Flow or Big Data Flow

Hi all! I recently started working with SSIS and one of the things that is puzzling me the most is what's the best way to go:

A small control flow, with large data flow tasks A control flow with more, but smaller, data flow tasksAny help will be greatly appreciated.
Thanks,
Ricardo
Multiple smaller data flows are generally better than a single big one. Breaking a large process into smaller data flows allows you to manage memory better and offers more opportunities for restartability. Large data flows can also suffer from threading problems in the current version.

|||

Dear Friend,

Depends on your system requirements. But there is things that you only can do inside dataflow...

Regards!

|||

Ricardo,

I'd generally agree with what the other guys have said. However, I think it would be rare that you would get the chance to make this decision. The nature of your dataflow is determined by...well...whatever the reason you're building it is. You don't generally get the chance to say "Hmmm, I think i'll put less components in this dataflow". You can of course put more, but you would be foolish to do so.

Similarly, when you have a requirement its pretty clear whether you need a task or a component to achieve it so, again, you don't (usually) have a choice.

-Jamie

|||Thanks everyone for the quick replies. I'm finding it easier as I go along. Some mistakes in the beginning, but after a while, things start being a bit more logical.

Thanks,
Ricardo

Please Advise: Big Control Flow or Big Data Flow

Hi all! I recently started working with SSIS and one of the things that is puzzling me the most is what's the best way to go:

A small control flow, with large data flow tasks A control flow with more, but smaller, data flow tasksAny help will be greatly appreciated.
Thanks,
Ricardo
Multiple smaller data flows are generally better than a single big one. Breaking a large process into smaller data flows allows you to manage memory better and offers more opportunities for restartability. Large data flows can also suffer from threading problems in the current version.

|||

Dear Friend,

Depends on your system requirements. But there is things that you only can do inside dataflow...

Regards!

|||

Ricardo,

I'd generally agree with what the other guys have said. However, I think it would be rare that you would get the chance to make this decision. The nature of your dataflow is determined by...well...whatever the reason you're building it is. You don't generally get the chance to say "Hmmm, I think i'll put less components in this dataflow". You can of course put more, but you would be foolish to do so.

Similarly, when you have a requirement its pretty clear whether you need a task or a component to achieve it so, again, you don't (usually) have a choice.

-Jamie

|||Thanks everyone for the quick replies. I'm finding it easier as I go along. Some mistakes in the beginning, but after a while, things start being a bit more logical.

Thanks,
Ricardo

Please advise!

Hi there!!

I just want to ask one question and i am looking for advice or recommendation.

I want to make an application using windows application in .NET. this application is only to have one or two users to enter details of clients on the database using the application and it will be a search for client name or number and other search methods which is similar.

My question now, what database shall i use for this kind of application SQL server or MS Access. i am looking for a new product to use as the cleint can not afford expensive software. Please advise!! thanks!!What about the free version of MS SQL Server (called MSDE)?

Functionaly it's the same as regular SQL Server, but with some performance restrictions (not intended for large number of users) and does not come with Enterprise Manager.

http://msdn.microsoft.com/sql/msde/msde/default.aspx

Cheers...|||... or the SQL 2005 EXPRESS edition which is a free download from MS. It's the full monty apart from enterprise-level features, and it's restricted to 1 processor and a 4Gb database, but it is free and will integrate fully with VS.NET 2005.|||Hi !!

Thank you all for your reply !!!

Just Three questions:-

1) As the application that i iw ill write will be for commercial use, can i use the software free and no license is required to pay for?

2) i use VS.NET 2003, will that be ok?

3) CAn the suggested versions of the SQL Server hold a large number of data? and is it easy in the future to convert to a better versions with transfer all the data from old to new version (in case it is needed in the future)?

Thank you again for your help, and i wish you can advise more!!!sql

Please advise re. restoring master/msdb on different server

I'm sure restoring master/msdb on the same server should
be no issue. But restoring on separate hardware might
have these issues (if you know others please tell me):
1: File path (drive letter, file path) different for the
location of the database on the replacement server;
2: Security issues. The separate Windows installation is
sure to have different SID, and since SQL Server security
is tightly integrated with Windows security, what might be
broken, what will the restore take care of, and what needs
to be manually fixed up-and how? (BTW, our installation
uses mixed mode security)
Regarding issue 1: I have experienced that restoring over
an existing database causes the file locations to be
automatically fixed up by the restore, taking the file
locations from the database being overwritten rather than
the locations saved in the backup. Will this work for
master/msdb?
I don't know what to expect regarding issue #2.
Any help appreciated! Thanks!Hi
Try the following:
http://support.microsoft.com/defaul...kb;EN-US;224071
John
"Scott" <anonymous@.discussions.microsoft.com> wrote in message
news:094d01c3fd71$ab484d80$a601280a@.phx.gbl...
> I'm sure restoring master/msdb on the same server should
> be no issue. But restoring on separate hardware might
> have these issues (if you know others please tell me):
> 1: File path (drive letter, file path) different for the
> location of the database on the replacement server;
> 2: Security issues. The separate Windows installation is
> sure to have different SID, and since SQL Server security
> is tightly integrated with Windows security, what might be
> broken, what will the restore take care of, and what needs
> to be manually fixed up-and how? (BTW, our installation
> uses mixed mode security)
> Regarding issue 1: I have experienced that restoring over
> an existing database causes the file locations to be
> automatically fixed up by the restore, taking the file
> locations from the database being overwritten rather than
> the locations saved in the backup. Will this work for
> master/msdb?
> I don't know what to expect regarding issue #2.
> Any help appreciated! Thanks!
>|||OK, thank you, these seem to indicate my concerns were
right.
However, all the documentation you pointed me at seems to
assume the original databases are operational; they are
read, or even modified, by these procedures, and
transferred as operational databases.
I need procedures for FAILED systems, i.e., only the
backups are available, not the databases themselves.
Any more help, anyone?
Thanks!

>--Original Message--
>Hi
>Try the following:
>http://support.microsoft.com/default.aspx?scid=kb;EN-
US;224071
>John
>"Scott" <anonymous@.discussions.microsoft.com> wrote in
message
>news:094d01c3fd71$ab484d80$a601280a@.phx.gbl...
the
is
security
be
needs
over
than
>
>.
>|||Hi
I have never tried it, but if you can restore the database into another
database then you can get the files, so you can then follow the procedure.
John
<anonymous@.discussions.microsoft.com> wrote in message
news:357a01c3fd86$69962b40$a001280a@.phx.gbl...
> OK, thank you, these seem to indicate my concerns were
> right.
> However, all the documentation you pointed me at seems to
> assume the original databases are operational; they are
> read, or even modified, by these procedures, and
> transferred as operational databases.
> I need procedures for FAILED systems, i.e., only the
> backups are available, not the databases themselves.
> Any more help, anyone?
> Thanks!
>
>
> US;224071
> message
> the
> is
> security
> be
> needs
> over
> than|||!!!
Yeah, that sound right. Ahh, Friday. Sorry for my fuzzy
head. And THANKS for your response.
Don't know the real state of our failed server, so I don't
know if we'll really have to do this. If we DO, I'll
respond and let you know.
Thanks again!
--Scott

>--Original Message--
>Hi
>I have never tried it, but if you can restore the
database into another
>database then you can get the files, so you can then
follow the procedure.
>John
><anonymous@.discussions.microsoft.com> wrote in message
>news:357a01c3fd86$69962b40$a001280a@.phx.gbl...
to
should
might
me):
installation
might
installation
file
for
>
>.
>

Please advise re. restoring master/msdb on different server

I'm sure restoring master/msdb on the same server should
be no issue. But restoring on separate hardware might
have these issues (if you know others please tell me):
1: File path (drive letter, file path) different for the
location of the database on the replacement server;
2: Security issues. The separate Windows installation is
sure to have different SID, and since SQL Server security
is tightly integrated with Windows security, what might be
broken, what will the restore take care of, and what needs
to be manually fixed up-and how? (BTW, our installation
uses mixed mode security)
Regarding issue 1: I have experienced that restoring over
an existing database causes the file locations to be
automatically fixed up by the restore, taking the file
locations from the database being overwritten rather than
the locations saved in the backup. Will this work for
master/msdb?
I don't know what to expect regarding issue #2.
Any help appreciated! Thanks!Hi
Try the following:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;224071
John
"Scott" <anonymous@.discussions.microsoft.com> wrote in message
news:094d01c3fd71$ab484d80$a601280a@.phx.gbl...
> I'm sure restoring master/msdb on the same server should
> be no issue. But restoring on separate hardware might
> have these issues (if you know others please tell me):
> 1: File path (drive letter, file path) different for the
> location of the database on the replacement server;
> 2: Security issues. The separate Windows installation is
> sure to have different SID, and since SQL Server security
> is tightly integrated with Windows security, what might be
> broken, what will the restore take care of, and what needs
> to be manually fixed up-and how? (BTW, our installation
> uses mixed mode security)
> Regarding issue 1: I have experienced that restoring over
> an existing database causes the file locations to be
> automatically fixed up by the restore, taking the file
> locations from the database being overwritten rather than
> the locations saved in the backup. Will this work for
> master/msdb?
> I don't know what to expect regarding issue #2.
> Any help appreciated! Thanks!
>|||OK, thank you, these seem to indicate my concerns were
right.
However, all the documentation you pointed me at seems to
assume the original databases are operational; they are
read, or even modified, by these procedures, and
transferred as operational databases.
I need procedures for FAILED systems, i.e., only the
backups are available, not the databases themselves.
Any more help, anyone?
Thanks!
>--Original Message--
>Hi
>Try the following:
>http://support.microsoft.com/default.aspx?scid=kb;EN-
US;224071
>John
>"Scott" <anonymous@.discussions.microsoft.com> wrote in
message
>news:094d01c3fd71$ab484d80$a601280a@.phx.gbl...
>> I'm sure restoring master/msdb on the same server should
>> be no issue. But restoring on separate hardware might
>> have these issues (if you know others please tell me):
>> 1: File path (drive letter, file path) different for
the
>> location of the database on the replacement server;
>> 2: Security issues. The separate Windows installation
is
>> sure to have different SID, and since SQL Server
security
>> is tightly integrated with Windows security, what might
be
>> broken, what will the restore take care of, and what
needs
>> to be manually fixed up-and how? (BTW, our installation
>> uses mixed mode security)
>> Regarding issue 1: I have experienced that restoring
over
>> an existing database causes the file locations to be
>> automatically fixed up by the restore, taking the file
>> locations from the database being overwritten rather
than
>> the locations saved in the backup. Will this work for
>> master/msdb?
>> I don't know what to expect regarding issue #2.
>> Any help appreciated! Thanks!
>
>.
>|||Hi
I have never tried it, but if you can restore the database into another
database then you can get the files, so you can then follow the procedure.
John
<anonymous@.discussions.microsoft.com> wrote in message
news:357a01c3fd86$69962b40$a001280a@.phx.gbl...
> OK, thank you, these seem to indicate my concerns were
> right.
> However, all the documentation you pointed me at seems to
> assume the original databases are operational; they are
> read, or even modified, by these procedures, and
> transferred as operational databases.
> I need procedures for FAILED systems, i.e., only the
> backups are available, not the databases themselves.
> Any more help, anyone?
> Thanks!
>
> >--Original Message--
> >Hi
> >
> >Try the following:
> >http://support.microsoft.com/default.aspx?scid=kb;EN-
> US;224071
> >
> >John
> >
> >"Scott" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:094d01c3fd71$ab484d80$a601280a@.phx.gbl...
> >> I'm sure restoring master/msdb on the same server should
> >> be no issue. But restoring on separate hardware might
> >> have these issues (if you know others please tell me):
> >>
> >> 1: File path (drive letter, file path) different for
> the
> >> location of the database on the replacement server;
> >>
> >> 2: Security issues. The separate Windows installation
> is
> >> sure to have different SID, and since SQL Server
> security
> >> is tightly integrated with Windows security, what might
> be
> >> broken, what will the restore take care of, and what
> needs
> >> to be manually fixed up-and how? (BTW, our installation
> >> uses mixed mode security)
> >>
> >> Regarding issue 1: I have experienced that restoring
> over
> >> an existing database causes the file locations to be
> >> automatically fixed up by the restore, taking the file
> >> locations from the database being overwritten rather
> than
> >> the locations saved in the backup. Will this work for
> >> master/msdb?
> >>
> >> I don't know what to expect regarding issue #2.
> >>
> >> Any help appreciated! Thanks!
> >>
> >
> >
> >.
> >|||!!!
Yeah, that sound right. Ahh, Friday. Sorry for my fuzzy
head. And THANKS for your response.
Don't know the real state of our failed server, so I don't
know if we'll really have to do this. If we DO, I'll
respond and let you know.
Thanks again!
--Scott
>--Original Message--
>Hi
>I have never tried it, but if you can restore the
database into another
>database then you can get the files, so you can then
follow the procedure.
>John
><anonymous@.discussions.microsoft.com> wrote in message
>news:357a01c3fd86$69962b40$a001280a@.phx.gbl...
>> OK, thank you, these seem to indicate my concerns were
>> right.
>> However, all the documentation you pointed me at seems
to
>> assume the original databases are operational; they are
>> read, or even modified, by these procedures, and
>> transferred as operational databases.
>> I need procedures for FAILED systems, i.e., only the
>> backups are available, not the databases themselves.
>> Any more help, anyone?
>> Thanks!
>>
>> >--Original Message--
>> >Hi
>> >
>> >Try the following:
>> >http://support.microsoft.com/default.aspx?scid=kb;EN-
>> US;224071
>> >
>> >John
>> >
>> >"Scott" <anonymous@.discussions.microsoft.com> wrote in
>> message
>> >news:094d01c3fd71$ab484d80$a601280a@.phx.gbl...
>> >> I'm sure restoring master/msdb on the same server
should
>> >> be no issue. But restoring on separate hardware
might
>> >> have these issues (if you know others please tell
me):
>> >>
>> >> 1: File path (drive letter, file path) different for
>> the
>> >> location of the database on the replacement server;
>> >>
>> >> 2: Security issues. The separate Windows
installation
>> is
>> >> sure to have different SID, and since SQL Server
>> security
>> >> is tightly integrated with Windows security, what
might
>> be
>> >> broken, what will the restore take care of, and what
>> needs
>> >> to be manually fixed up-and how? (BTW, our
installation
>> >> uses mixed mode security)
>> >>
>> >> Regarding issue 1: I have experienced that restoring
>> over
>> >> an existing database causes the file locations to be
>> >> automatically fixed up by the restore, taking the
file
>> >> locations from the database being overwritten rather
>> than
>> >> the locations saved in the backup. Will this work
for
>> >> master/msdb?
>> >>
>> >> I don't know what to expect regarding issue #2.
>> >>
>> >> Any help appreciated! Thanks!
>> >>
>> >
>> >
>> >.
>> >
>
>.
>

Please advise on approach

Hi,
Apologies for the vague subject title but I couldn't think of a snappy
title to describe what I am doing. Please bear with me as I explain...
I am developing an application that records data from several
different sources operating at relatively high rates (e.g. >5 times
per sec). The data from the various sources is diverse, in terms of
the type (e.g. data from source A may comprise of 5 parameters in
binary format, whereas data from source B may comprise of a single
parameter in ascii format). The one thing they have in common is a
timestamp. The timestamp although unique for each source is not unique
amongst all sources. For example although there will be only ever be a
single row in TableA with a particular timestamp representing a
particular point in time, there may also be a row in TableB with the
same timestamp. In an attempt to have the writes as efficient as
possible and to prevent the tables growing too big I record data from
each source to different tables. These tables are created at runtime
before I begin to record the data. Following a period of recording
some tables may still have in excess of 500,000 rows. I now wish to
reconstruct the sequence of events in chronological order, i.e.
retrieve the earliest data recorded from all the sources, followed by
the next and so on. I'm wondering how to approach this. I was thinking
of creating a single large table into which I would insert the
timestamp and ID of every row from each source as well as the table
name, then ceating a clustered index on the timestamp field, so that
the rows would be physically sorted in chronlogical order. This table
may look like the following when complete
1 09/22/2004 16:00:00 Table1
2 09/22/2004 16:00:01 Table1
1 09/22/2004 16:00:02 Table2
3 09/22/2004 16:00:03 Table1
2 09/22/2004 16:00:03 Table2
etc.
This would only ever have to happen once (I appreciate it may take
some time to construct) - then each time I need to I could simply move
through the table row by row retrieving the ID and table name which I
could then use as parameters in a query that would retrieve the data.
I'd appreciate any feedback on this approach i.e. is it madness! I was
wondering about views etc. but I don't know if these could help at all
Thanks,
Paul
First, timestamp has no relationship to date or time; the synonym is
rowversion. It is unique for a db and appears to be currently be
implemented in such a way as to be predictable. Based on the current
implementation, one can make comparisons (involving greater than and less
than) that give correct results. However, I don't think the current
implementation can be safely relied on and, IIRC, MS only supports equal /
not equal comparisons. Note - since you are posting in a db-related NG, I
assume that your reference to timestamp is actually a reference to the sql
server datatype. If this assumption is incorrect - well that's your fault
for using an ambiguous term outside of the implied context.
Second, datetime values are accurate to 3 milliseconds. If your term
"timestamp" refers to a datatype of this nature, is this accuracy
sufficient? Note that there are two aspects to accuracy. First is the
relative difference in accuracy between your datasource timestamp values and
this datatype. The second aspect is relative to a difference in accuracy.
Your timestamp data might be more accurate (e.g., 1 ms) but occurs at
intervals that are significantly less accurate (e.g., > 3 ms). Of course,
you could use a different datatype, losing the ability to use the builtin
datetime functions and creating potential ordering problems.
Third, a table is, be definition, unordered. Your narrative assumes and
implies otherwise. Clustering does affect physical ordering. However,
there is nothing that can guarantee you can access rows in physical
insertion order unless that order can be determined by the data itself. In
other words, you must provide a way to include the appropriate information
in an order by clause. Even with a heap and a cursor, I'm not certain that
there is any way to guarantee the desired order.
Given this information, how do you intend to store the data (regardless of
number of tables) in such a way that one can reconstruct the events in
chrono. order? There are two implications in your narrative that might be
problematic. First, is that "reconstruction" implies a single thread of
execution. Is this valid? If not, then you might also need to record
additional information to differentiate the multiple streams of data (which
just might be adding data at the same instant in time). The other potential
pitfall is that reconstruction often implies "re-running" (e.g.,
reconstruction of the data in the same order/timeframe). Fear this!
So now we're down to identifying chronological order. Assume that source A
has data with timestamp 10:22:01 (ignoring the date portion for simplicity)
and source B has data with the same timestamp (you said this was possible).
They both get inserted into the DB (regardless of table) at roughly the same
time. Based on data alone, it is not possible to determine which is first.
What does the DB have to assist? You could use a timestamp for the table
(or tables) and rely on the current implementation to derive order. Somone
recently posted that this type of solution was working. You could use a
datetime column to mark each row with the datetime of insert. This approach
may suffer due to accuracy limitations. Lastly, you could use a single
table with an identity. This should logically work (and it is what you
considered) but may be problematic due to contention / locking. Hotspots
will definitely be something to avoid. Note that this approach is also
predicated on the immediate insertion of data, implying that every data
"event" is recorded on a one-by-one basis. This is not the best approach in
terms of network usage (and does not scale well).
You might want to investigate any potential client-side approaches as well.
In a single-threaded application, you could also impose your own serial
numbering on the data before insertion.
Lastly, you might want to indicate what your ultimate goal is. Relational
databases are often slower than file-based approaches for data of this type
(there is a lot of overhead that you may not need for recording data).
There are other ways to record "data" in fifo order that might later to
imported into a real database for analysis or reporting. If there are no
real relationships in your data, then perhaps you don't need a rdbms.
Without knowing what you intend to do with the information, this is the
approach I would investigate first.
"Paul" <paulsmith5@.hotmail.com> wrote in message
news:ca236fb1.0409220850.2058abc9@.posting.google.c om...
> Hi,
> Apologies for the vague subject title but I couldn't think of a snappy
> title to describe what I am doing. Please bear with me as I explain...
> I am developing an application that records data from several
> different sources operating at relatively high rates (e.g. >5 times
> per sec). The data from the various sources is diverse, in terms of
> the type (e.g. data from source A may comprise of 5 parameters in
> binary format, whereas data from source B may comprise of a single
> parameter in ascii format). The one thing they have in common is a
> timestamp. The timestamp although unique for each source is not unique
> amongst all sources. For example although there will be only ever be a
> single row in TableA with a particular timestamp representing a
> particular point in time, there may also be a row in TableB with the
> same timestamp. In an attempt to have the writes as efficient as
> possible and to prevent the tables growing too big I record data from
> each source to different tables. These tables are created at runtime
> before I begin to record the data. Following a period of recording
> some tables may still have in excess of 500,000 rows. I now wish to
> reconstruct the sequence of events in chronological order, i.e.
> retrieve the earliest data recorded from all the sources, followed by
> the next and so on. I'm wondering how to approach this. I was thinking
> of creating a single large table into which I would insert the
> timestamp and ID of every row from each source as well as the table
> name, then ceating a clustered index on the timestamp field, so that
> the rows would be physically sorted in chronlogical order. This table
> may look like the following when complete
> 1 09/22/2004 16:00:00 Table1
> 2 09/22/2004 16:00:01 Table1
> 1 09/22/2004 16:00:02 Table2
> 3 09/22/2004 16:00:03 Table1
> 2 09/22/2004 16:00:03 Table2
> etc.
> This would only ever have to happen once (I appreciate it may take
> some time to construct) - then each time I need to I could simply move
> through the table row by row retrieving the ID and table name which I
> could then use as parameters in a query that would retrieve the data.
> I'd appreciate any feedback on this approach i.e. is it madness! I was
> wondering about views etc. but I don't know if these could help at all
> Thanks,
> Paul
|||Hi Scott,
Thanks for the reply. Apologies for any confusion arising from my use
of the term timestamp - it does not refer to the sql data type in this
case, rather to the datetime at which the source produced the data -
which is provided by the source itself. Therefore the limitations in
terms of sql server accuracy you refer to do not apply in this case.
Limitations in terms of accuracy emanate from the sources themselves
and I don't wish to concern myself with them at this point as much as
to say that action has been taken to ensure the are synchronised as
much as possible. I did take the precaution (whether right or wrong)
of recording however the millisecond portion of the 'timestamp' to a
separate field to maintain its integrity. I note your point on the
clustered index/ordering thanks. I think that the order in which the
data was produced by the source can be determined from the data itself
- notably the timestamp. The physical insertion order does not concern
me but perhaps if needed I could use an identity field - but if a
single thread is involved as is the case this is a mute point (I
think). Regarding identifying chronological order you are correct when
you ask where can the database assist in differentiating between two
records with the same timestamp/datetimes but I'm thinking it doesn't
have to. I'm only interested in it differentiating between records
with different datetimes i.e. a record with a datetime preceding
another one will be higher up in the order. When I replay the data in
sequence and I encounter two records with the same datetime the delay
in displaying them will be down to how quickly they can be processed
and when you are talking about portions of a second the result will
often be invisible to the naked eye - not perfect but not critical
either. As far as using a non-relational system that's out of the
question at this point.
Again thanks for the reply, I found it useful and appreciate your
time. Perhaps I will refrain from asking such general questions in
future - I think they can raise more questions then they answer - a
problem hard to address through this medium.
Paul
Assume that source A
> has data with timestamp 10:22:01 (ignoring the date portion for simplicity)
> and source B has data with the same timestamp (you said this was possible).
> They both get inserted into the DB (regardless of table) at roughly the same
> time. Based on data alone, it is not possible to determine which is first.
> What does the DB have to assist?
"Scott Morris" <bogus@.bogus.com> wrote in message news:<uNMwmBNoEHA.3324@.TK2MSFTNGP12.phx.gbl>...[vbcol=seagreen]
> First, timestamp has no relationship to date or time; the synonym is
> rowversion. It is unique for a db and appears to be currently be
> implemented in such a way as to be predictable. Based on the current
> implementation, one can make comparisons (involving greater than and less
> than) that give correct results. However, I don't think the current
> implementation can be safely relied on and, IIRC, MS only supports equal /
> not equal comparisons. Note - since you are posting in a db-related NG, I
> assume that your reference to timestamp is actually a reference to the sql
> server datatype. If this assumption is incorrect - well that's your fault
> for using an ambiguous term outside of the implied context.
> Second, datetime values are accurate to 3 milliseconds. If your term
> "timestamp" refers to a datatype of this nature, is this accuracy
> sufficient? Note that there are two aspects to accuracy. First is the
> relative difference in accuracy between your datasource timestamp values and
> this datatype. The second aspect is relative to a difference in accuracy.
> Your timestamp data might be more accurate (e.g., 1 ms) but occurs at
> intervals that are significantly less accurate (e.g., > 3 ms). Of course,
> you could use a different datatype, losing the ability to use the builtin
> datetime functions and creating potential ordering problems.
> Third, a table is, be definition, unordered. Your narrative assumes and
> implies otherwise. Clustering does affect physical ordering. However,
> there is nothing that can guarantee you can access rows in physical
> insertion order unless that order can be determined by the data itself. In
> other words, you must provide a way to include the appropriate information
> in an order by clause. Even with a heap and a cursor, I'm not certain that
> there is any way to guarantee the desired order.
> Given this information, how do you intend to store the data (regardless of
> number of tables) in such a way that one can reconstruct the events in
> chrono. order? There are two implications in your narrative that might be
> problematic. First, is that "reconstruction" implies a single thread of
> execution. Is this valid? If not, then you might also need to record
> additional information to differentiate the multiple streams of data (which
> just might be adding data at the same instant in time). The other potential
> pitfall is that reconstruction often implies "re-running" (e.g.,
> reconstruction of the data in the same order/timeframe). Fear this!
> So now we're down to identifying chronological order. Assume that source A
> has data with timestamp 10:22:01 (ignoring the date portion for simplicity)
> and source B has data with the same timestamp (you said this was possible).
> They both get inserted into the DB (regardless of table) at roughly the same
> time. Based on data alone, it is not possible to determine which is first.
> What does the DB have to assist? You could use a timestamp for the table
> (or tables) and rely on the current implementation to derive order. Somone
> recently posted that this type of solution was working. You could use a
> datetime column to mark each row with the datetime of insert. This approach
> may suffer due to accuracy limitations. Lastly, you could use a single
> table with an identity. This should logically work (and it is what you
> considered) but may be problematic due to contention / locking. Hotspots
> will definitely be something to avoid. Note that this approach is also
> predicated on the immediate insertion of data, implying that every data
> "event" is recorded on a one-by-one basis. This is not the best approach in
> terms of network usage (and does not scale well).
> You might want to investigate any potential client-side approaches as well.
> In a single-threaded application, you could also impose your own serial
> numbering on the data before insertion.
> Lastly, you might want to indicate what your ultimate goal is. Relational
> databases are often slower than file-based approaches for data of this type
> (there is a lot of overhead that you may not need for recording data).
> There are other ways to record "data" in fifo order that might later to
> imported into a real database for analysis or reporting. If there are no
> real relationships in your data, then perhaps you don't need a rdbms.
> Without knowing what you intend to do with the information, this is the
> approach I would investigate first.
> "Paul" <paulsmith5@.hotmail.com> wrote in message
> news:ca236fb1.0409220850.2058abc9@.posting.google.c om...
|||It's very difficult to answer general questions in a NG. Context usually
has direct bearing on the issues and the context is difficult to communicate
(as well as lengthy). From the short discussion, it looks like you need to
conduct a thorough analysis of the data (a good bit you've already done).
The characteristics of the data will lead (or force!) you to the appropriate
design. Just be aware of the datatype issues (some of which I mentioned)
and their potential effects on your system. One last comment - you might
want to conduct some testing involving a typically loaded machine / network
to verify that it can handle the expected volume of inserts. Better to know
this ahead of time (where you can design around it) then discover it
afterwards.
Good luck.
"Paul" <paulsmith5@.hotmail.com> wrote in message
news:ca236fb1.0409230256.6a4876b0@.posting.google.c om...[vbcol=seagreen]
> Hi Scott,
> Thanks for the reply. Apologies for any confusion arising from my use
> of the term timestamp - it does not refer to the sql data type in this
> case, rather to the datetime at which the source produced the data -
> which is provided by the source itself. Therefore the limitations in
> terms of sql server accuracy you refer to do not apply in this case.
> Limitations in terms of accuracy emanate from the sources themselves
> and I don't wish to concern myself with them at this point as much as
> to say that action has been taken to ensure the are synchronised as
> much as possible. I did take the precaution (whether right or wrong)
> of recording however the millisecond portion of the 'timestamp' to a
> separate field to maintain its integrity. I note your point on the
> clustered index/ordering thanks. I think that the order in which the
> data was produced by the source can be determined from the data itself
> - notably the timestamp. The physical insertion order does not concern
> me but perhaps if needed I could use an identity field - but if a
> single thread is involved as is the case this is a mute point (I
> think). Regarding identifying chronological order you are correct when
> you ask where can the database assist in differentiating between two
> records with the same timestamp/datetimes but I'm thinking it doesn't
> have to. I'm only interested in it differentiating between records
> with different datetimes i.e. a record with a datetime preceding
> another one will be higher up in the order. When I replay the data in
> sequence and I encounter two records with the same datetime the delay
> in displaying them will be down to how quickly they can be processed
> and when you are talking about portions of a second the result will
> often be invisible to the naked eye - not perfect but not critical
> either. As far as using a non-relational system that's out of the
> question at this point.
> Again thanks for the reply, I found it useful and appreciate your
> time. Perhaps I will refrain from asking such general questions in
> future - I think they can raise more questions then they answer - a
> problem hard to address through this medium.
> Paul
>
> Assume that source A
simplicity)[vbcol=seagreen]
possible).[vbcol=seagreen]
same[vbcol=seagreen]
first.
> "Scott Morris" <bogus@.bogus.com> wrote in message
news:<uNMwmBNoEHA.3324@.TK2MSFTNGP12.phx.gbl>...[vbcol=seagreen]
less[vbcol=seagreen]
/[vbcol=seagreen]
I[vbcol=seagreen]
sql[vbcol=seagreen]
fault[vbcol=seagreen]
and[vbcol=seagreen]
accuracy.[vbcol=seagreen]
course,[vbcol=seagreen]
builtin[vbcol=seagreen]
In[vbcol=seagreen]
information[vbcol=seagreen]
that[vbcol=seagreen]
of[vbcol=seagreen]
be[vbcol=seagreen]
(which[vbcol=seagreen]
potential[vbcol=seagreen]
source A[vbcol=seagreen]
simplicity)[vbcol=seagreen]
possible).[vbcol=seagreen]
same[vbcol=seagreen]
first.[vbcol=seagreen]
table[vbcol=seagreen]
Somone[vbcol=seagreen]
approach[vbcol=seagreen]
Hotspots[vbcol=seagreen]
approach in[vbcol=seagreen]
well.[vbcol=seagreen]
Relational[vbcol=seagreen]
type[vbcol=seagreen]
no[vbcol=seagreen]

Please advise on approach

Hi,
Apologies for the vague subject title but I couldn't think of a snappy
title to describe what I am doing. Please bear with me as I explain...
I am developing an application that records data from several
different sources operating at relatively high rates (e.g. >5 times
per sec). The data from the various sources is diverse, in terms of
the type (e.g. data from source A may comprise of 5 parameters in
binary format, whereas data from source B may comprise of a single
parameter in ascii format). The one thing they have in common is a
timestamp. The timestamp although unique for each source is not unique
amongst all sources. For example although there will be only ever be a
single row in TableA with a particular timestamp representing a
particular point in time, there may also be a row in TableB with the
same timestamp. In an attempt to have the writes as efficient as
possible and to prevent the tables growing too big I record data from
each source to different tables. These tables are created at runtime
before I begin to record the data. Following a period of recording
some tables may still have in excess of 500,000 rows. I now wish to
reconstruct the sequence of events in chronological order, i.e.
retrieve the earliest data recorded from all the sources, followed by
the next and so on. I'm wondering how to approach this. I was thinking
of creating a single large table into which I would insert the
timestamp and ID of every row from each source as well as the table
name, then ceating a clustered index on the timestamp field, so that
the rows would be physically sorted in chronlogical order. This table
may look like the following when complete
1 09/22/2004 16:00:00 Table1
2 09/22/2004 16:00:01 Table1
1 09/22/2004 16:00:02 Table2
3 09/22/2004 16:00:03 Table1
2 09/22/2004 16:00:03 Table2
etc.
This would only ever have to happen once (I appreciate it may take
some time to construct) - then each time I need to I could simply move
through the table row by row retrieving the ID and table name which I
could then use as parameters in a query that would retrieve the data.
I'd appreciate any feedback on this approach i.e. is it madness! I was
wondering about views etc. but I don't know if these could help at all
Thanks,
PaulFirst, timestamp has no relationship to date or time; the synonym is
rowversion. It is unique for a db and appears to be currently be
implemented in such a way as to be predictable. Based on the current
implementation, one can make comparisons (involving greater than and less
than) that give correct results. However, I don't think the current
implementation can be safely relied on and, IIRC, MS only supports equal /
not equal comparisons. Note - since you are posting in a db-related NG, I
assume that your reference to timestamp is actually a reference to the sql
server datatype. If this assumption is incorrect - well that's your fault
for using an ambiguous term outside of the implied context.
Second, datetime values are accurate to 3 milliseconds. If your term
"timestamp" refers to a datatype of this nature, is this accuracy
sufficient? Note that there are two aspects to accuracy. First is the
relative difference in accuracy between your datasource timestamp values and
this datatype. The second aspect is relative to a difference in accuracy.
Your timestamp data might be more accurate (e.g., 1 ms) but occurs at
intervals that are significantly less accurate (e.g., > 3 ms). Of course,
you could use a different datatype, losing the ability to use the builtin
datetime functions and creating potential ordering problems.
Third, a table is, be definition, unordered. Your narrative assumes and
implies otherwise. Clustering does affect physical ordering. However,
there is nothing that can guarantee you can access rows in physical
insertion order unless that order can be determined by the data itself. In
other words, you must provide a way to include the appropriate information
in an order by clause. Even with a heap and a cursor, I'm not certain that
there is any way to guarantee the desired order.
Given this information, how do you intend to store the data (regardless of
number of tables) in such a way that one can reconstruct the events in
chrono. order? There are two implications in your narrative that might be
problematic. First, is that "reconstruction" implies a single thread of
execution. Is this valid? If not, then you might also need to record
additional information to differentiate the multiple streams of data (which
just might be adding data at the same instant in time). The other potential
pitfall is that reconstruction often implies "re-running" (e.g.,
reconstruction of the data in the same order/timeframe). Fear this!
So now we're down to identifying chronological order. Assume that source A
has data with timestamp 10:22:01 (ignoring the date portion for simplicity)
and source B has data with the same timestamp (you said this was possible).
They both get inserted into the DB (regardless of table) at roughly the same
time. Based on data alone, it is not possible to determine which is first.
What does the DB have to assist? You could use a timestamp for the table
(or tables) and rely on the current implementation to derive order. Somone
recently posted that this type of solution was working. You could use a
datetime column to mark each row with the datetime of insert. This approach
may suffer due to accuracy limitations. Lastly, you could use a single
table with an identity. This should logically work (and it is what you
considered) but may be problematic due to contention / locking. Hotspots
will definitely be something to avoid. Note that this approach is also
predicated on the immediate insertion of data, implying that every data
"event" is recorded on a one-by-one basis. This is not the best approach in
terms of network usage (and does not scale well).
You might want to investigate any potential client-side approaches as well.
In a single-threaded application, you could also impose your own serial
numbering on the data before insertion.
Lastly, you might want to indicate what your ultimate goal is. Relational
databases are often slower than file-based approaches for data of this type
(there is a lot of overhead that you may not need for recording data).
There are other ways to record "data" in fifo order that might later to
imported into a real database for analysis or reporting. If there are no
real relationships in your data, then perhaps you don't need a rdbms.
Without knowing what you intend to do with the information, this is the
approach I would investigate first.
"Paul" <paulsmith5@.hotmail.com> wrote in message
news:ca236fb1.0409220850.2058abc9@.posting.google.com...
> Hi,
> Apologies for the vague subject title but I couldn't think of a snappy
> title to describe what I am doing. Please bear with me as I explain...
> I am developing an application that records data from several
> different sources operating at relatively high rates (e.g. >5 times
> per sec). The data from the various sources is diverse, in terms of
> the type (e.g. data from source A may comprise of 5 parameters in
> binary format, whereas data from source B may comprise of a single
> parameter in ascii format). The one thing they have in common is a
> timestamp. The timestamp although unique for each source is not unique
> amongst all sources. For example although there will be only ever be a
> single row in TableA with a particular timestamp representing a
> particular point in time, there may also be a row in TableB with the
> same timestamp. In an attempt to have the writes as efficient as
> possible and to prevent the tables growing too big I record data from
> each source to different tables. These tables are created at runtime
> before I begin to record the data. Following a period of recording
> some tables may still have in excess of 500,000 rows. I now wish to
> reconstruct the sequence of events in chronological order, i.e.
> retrieve the earliest data recorded from all the sources, followed by
> the next and so on. I'm wondering how to approach this. I was thinking
> of creating a single large table into which I would insert the
> timestamp and ID of every row from each source as well as the table
> name, then ceating a clustered index on the timestamp field, so that
> the rows would be physically sorted in chronlogical order. This table
> may look like the following when complete
> 1 09/22/2004 16:00:00 Table1
> 2 09/22/2004 16:00:01 Table1
> 1 09/22/2004 16:00:02 Table2
> 3 09/22/2004 16:00:03 Table1
> 2 09/22/2004 16:00:03 Table2
> etc.
> This would only ever have to happen once (I appreciate it may take
> some time to construct) - then each time I need to I could simply move
> through the table row by row retrieving the ID and table name which I
> could then use as parameters in a query that would retrieve the data.
> I'd appreciate any feedback on this approach i.e. is it madness! I was
> wondering about views etc. but I don't know if these could help at all
> Thanks,
> Paul|||Hi Scott,
Thanks for the reply. Apologies for any confusion arising from my use
of the term timestamp - it does not refer to the sql data type in this
case, rather to the datetime at which the source produced the data -
which is provided by the source itself. Therefore the limitations in
terms of sql server accuracy you refer to do not apply in this case.
Limitations in terms of accuracy emanate from the sources themselves
and I don't wish to concern myself with them at this point as much as
to say that action has been taken to ensure the are synchronised as
much as possible. I did take the precaution (whether right or wrong)
of recording however the millisecond portion of the 'timestamp' to a
separate field to maintain its integrity. I note your point on the
clustered index/ordering thanks. I think that the order in which the
data was produced by the source can be determined from the data itself
- notably the timestamp. The physical insertion order does not concern
me but perhaps if needed I could use an identity field - but if a
single thread is involved as is the case this is a mute point (I
think). Regarding identifying chronological order you are correct when
you ask where can the database assist in differentiating between two
records with the same timestamp/datetimes but I'm thinking it doesn't
have to. I'm only interested in it differentiating between records
with different datetimes i.e. a record with a datetime preceding
another one will be higher up in the order. When I replay the data in
sequence and I encounter two records with the same datetime the delay
in displaying them will be down to how quickly they can be processed
and when you are talking about portions of a second the result will
often be invisible to the naked eye - not perfect but not critical
either. As far as using a non-relational system that's out of the
question at this point.
Again thanks for the reply, I found it useful and appreciate your
time. Perhaps I will refrain from asking such general questions in
future - I think they can raise more questions then they answer - a
problem hard to address through this medium.
Paul
Assume that source A
> has data with timestamp 10:22:01 (ignoring the date portion for simplicity)
> and source B has data with the same timestamp (you said this was possible).
> They both get inserted into the DB (regardless of table) at roughly the same
> time. Based on data alone, it is not possible to determine which is first.
> What does the DB have to assist?
"Scott Morris" <bogus@.bogus.com> wrote in message news:<uNMwmBNoEHA.3324@.TK2MSFTNGP12.phx.gbl>...
> First, timestamp has no relationship to date or time; the synonym is
> rowversion. It is unique for a db and appears to be currently be
> implemented in such a way as to be predictable. Based on the current
> implementation, one can make comparisons (involving greater than and less
> than) that give correct results. However, I don't think the current
> implementation can be safely relied on and, IIRC, MS only supports equal /
> not equal comparisons. Note - since you are posting in a db-related NG, I
> assume that your reference to timestamp is actually a reference to the sql
> server datatype. If this assumption is incorrect - well that's your fault
> for using an ambiguous term outside of the implied context.
> Second, datetime values are accurate to 3 milliseconds. If your term
> "timestamp" refers to a datatype of this nature, is this accuracy
> sufficient? Note that there are two aspects to accuracy. First is the
> relative difference in accuracy between your datasource timestamp values and
> this datatype. The second aspect is relative to a difference in accuracy.
> Your timestamp data might be more accurate (e.g., 1 ms) but occurs at
> intervals that are significantly less accurate (e.g., > 3 ms). Of course,
> you could use a different datatype, losing the ability to use the builtin
> datetime functions and creating potential ordering problems.
> Third, a table is, be definition, unordered. Your narrative assumes and
> implies otherwise. Clustering does affect physical ordering. However,
> there is nothing that can guarantee you can access rows in physical
> insertion order unless that order can be determined by the data itself. In
> other words, you must provide a way to include the appropriate information
> in an order by clause. Even with a heap and a cursor, I'm not certain that
> there is any way to guarantee the desired order.
> Given this information, how do you intend to store the data (regardless of
> number of tables) in such a way that one can reconstruct the events in
> chrono. order? There are two implications in your narrative that might be
> problematic. First, is that "reconstruction" implies a single thread of
> execution. Is this valid? If not, then you might also need to record
> additional information to differentiate the multiple streams of data (which
> just might be adding data at the same instant in time). The other potential
> pitfall is that reconstruction often implies "re-running" (e.g.,
> reconstruction of the data in the same order/timeframe). Fear this!
> So now we're down to identifying chronological order. Assume that source A
> has data with timestamp 10:22:01 (ignoring the date portion for simplicity)
> and source B has data with the same timestamp (you said this was possible).
> They both get inserted into the DB (regardless of table) at roughly the same
> time. Based on data alone, it is not possible to determine which is first.
> What does the DB have to assist? You could use a timestamp for the table
> (or tables) and rely on the current implementation to derive order. Somone
> recently posted that this type of solution was working. You could use a
> datetime column to mark each row with the datetime of insert. This approach
> may suffer due to accuracy limitations. Lastly, you could use a single
> table with an identity. This should logically work (and it is what you
> considered) but may be problematic due to contention / locking. Hotspots
> will definitely be something to avoid. Note that this approach is also
> predicated on the immediate insertion of data, implying that every data
> "event" is recorded on a one-by-one basis. This is not the best approach in
> terms of network usage (and does not scale well).
> You might want to investigate any potential client-side approaches as well.
> In a single-threaded application, you could also impose your own serial
> numbering on the data before insertion.
> Lastly, you might want to indicate what your ultimate goal is. Relational
> databases are often slower than file-based approaches for data of this type
> (there is a lot of overhead that you may not need for recording data).
> There are other ways to record "data" in fifo order that might later to
> imported into a real database for analysis or reporting. If there are no
> real relationships in your data, then perhaps you don't need a rdbms.
> Without knowing what you intend to do with the information, this is the
> approach I would investigate first.
> "Paul" <paulsmith5@.hotmail.com> wrote in message
> news:ca236fb1.0409220850.2058abc9@.posting.google.com...
> > Hi,
> >
> > Apologies for the vague subject title but I couldn't think of a snappy
> > title to describe what I am doing. Please bear with me as I explain...
> >
> > I am developing an application that records data from several
> > different sources operating at relatively high rates (e.g. >5 times
> > per sec). The data from the various sources is diverse, in terms of
> > the type (e.g. data from source A may comprise of 5 parameters in
> > binary format, whereas data from source B may comprise of a single
> > parameter in ascii format). The one thing they have in common is a
> > timestamp. The timestamp although unique for each source is not unique
> > amongst all sources. For example although there will be only ever be a
> > single row in TableA with a particular timestamp representing a
> > particular point in time, there may also be a row in TableB with the
> > same timestamp. In an attempt to have the writes as efficient as
> > possible and to prevent the tables growing too big I record data from
> > each source to different tables. These tables are created at runtime
> > before I begin to record the data. Following a period of recording
> > some tables may still have in excess of 500,000 rows. I now wish to
> > reconstruct the sequence of events in chronological order, i.e.
> > retrieve the earliest data recorded from all the sources, followed by
> > the next and so on. I'm wondering how to approach this. I was thinking
> > of creating a single large table into which I would insert the
> > timestamp and ID of every row from each source as well as the table
> > name, then ceating a clustered index on the timestamp field, so that
> > the rows would be physically sorted in chronlogical order. This table
> > may look like the following when complete
> >
> > 1 09/22/2004 16:00:00 Table1
> > 2 09/22/2004 16:00:01 Table1
> > 1 09/22/2004 16:00:02 Table2
> > 3 09/22/2004 16:00:03 Table1
> > 2 09/22/2004 16:00:03 Table2
> > etc.
> >
> > This would only ever have to happen once (I appreciate it may take
> > some time to construct) - then each time I need to I could simply move
> > through the table row by row retrieving the ID and table name which I
> > could then use as parameters in a query that would retrieve the data.
> > I'd appreciate any feedback on this approach i.e. is it madness! I was
> > wondering about views etc. but I don't know if these could help at all
> >
> > Thanks,
> >
> > Paul|||It's very difficult to answer general questions in a NG. Context usually
has direct bearing on the issues and the context is difficult to communicate
(as well as lengthy). From the short discussion, it looks like you need to
conduct a thorough analysis of the data (a good bit you've already done).
The characteristics of the data will lead (or force!) you to the appropriate
design. Just be aware of the datatype issues (some of which I mentioned)
and their potential effects on your system. One last comment - you might
want to conduct some testing involving a typically loaded machine / network
to verify that it can handle the expected volume of inserts. Better to know
this ahead of time (where you can design around it) then discover it
afterwards.
Good luck.
"Paul" <paulsmith5@.hotmail.com> wrote in message
news:ca236fb1.0409230256.6a4876b0@.posting.google.com...
> Hi Scott,
> Thanks for the reply. Apologies for any confusion arising from my use
> of the term timestamp - it does not refer to the sql data type in this
> case, rather to the datetime at which the source produced the data -
> which is provided by the source itself. Therefore the limitations in
> terms of sql server accuracy you refer to do not apply in this case.
> Limitations in terms of accuracy emanate from the sources themselves
> and I don't wish to concern myself with them at this point as much as
> to say that action has been taken to ensure the are synchronised as
> much as possible. I did take the precaution (whether right or wrong)
> of recording however the millisecond portion of the 'timestamp' to a
> separate field to maintain its integrity. I note your point on the
> clustered index/ordering thanks. I think that the order in which the
> data was produced by the source can be determined from the data itself
> - notably the timestamp. The physical insertion order does not concern
> me but perhaps if needed I could use an identity field - but if a
> single thread is involved as is the case this is a mute point (I
> think). Regarding identifying chronological order you are correct when
> you ask where can the database assist in differentiating between two
> records with the same timestamp/datetimes but I'm thinking it doesn't
> have to. I'm only interested in it differentiating between records
> with different datetimes i.e. a record with a datetime preceding
> another one will be higher up in the order. When I replay the data in
> sequence and I encounter two records with the same datetime the delay
> in displaying them will be down to how quickly they can be processed
> and when you are talking about portions of a second the result will
> often be invisible to the naked eye - not perfect but not critical
> either. As far as using a non-relational system that's out of the
> question at this point.
> Again thanks for the reply, I found it useful and appreciate your
> time. Perhaps I will refrain from asking such general questions in
> future - I think they can raise more questions then they answer - a
> problem hard to address through this medium.
> Paul
>
> Assume that source A
> > has data with timestamp 10:22:01 (ignoring the date portion for
simplicity)
> > and source B has data with the same timestamp (you said this was
possible).
> > They both get inserted into the DB (regardless of table) at roughly the
same
> > time. Based on data alone, it is not possible to determine which is
first.
> > What does the DB have to assist?
> "Scott Morris" <bogus@.bogus.com> wrote in message
news:<uNMwmBNoEHA.3324@.TK2MSFTNGP12.phx.gbl>...
> > First, timestamp has no relationship to date or time; the synonym is
> > rowversion. It is unique for a db and appears to be currently be
> > implemented in such a way as to be predictable. Based on the current
> > implementation, one can make comparisons (involving greater than and
less
> > than) that give correct results. However, I don't think the current
> > implementation can be safely relied on and, IIRC, MS only supports equal
/
> > not equal comparisons. Note - since you are posting in a db-related NG,
I
> > assume that your reference to timestamp is actually a reference to the
sql
> > server datatype. If this assumption is incorrect - well that's your
fault
> > for using an ambiguous term outside of the implied context.
> >
> > Second, datetime values are accurate to 3 milliseconds. If your term
> > "timestamp" refers to a datatype of this nature, is this accuracy
> > sufficient? Note that there are two aspects to accuracy. First is the
> > relative difference in accuracy between your datasource timestamp values
and
> > this datatype. The second aspect is relative to a difference in
accuracy.
> > Your timestamp data might be more accurate (e.g., 1 ms) but occurs at
> > intervals that are significantly less accurate (e.g., > 3 ms). Of
course,
> > you could use a different datatype, losing the ability to use the
builtin
> > datetime functions and creating potential ordering problems.
> >
> > Third, a table is, be definition, unordered. Your narrative assumes and
> > implies otherwise. Clustering does affect physical ordering. However,
> > there is nothing that can guarantee you can access rows in physical
> > insertion order unless that order can be determined by the data itself.
In
> > other words, you must provide a way to include the appropriate
information
> > in an order by clause. Even with a heap and a cursor, I'm not certain
that
> > there is any way to guarantee the desired order.
> >
> > Given this information, how do you intend to store the data (regardless
of
> > number of tables) in such a way that one can reconstruct the events in
> > chrono. order? There are two implications in your narrative that might
be
> > problematic. First, is that "reconstruction" implies a single thread of
> > execution. Is this valid? If not, then you might also need to record
> > additional information to differentiate the multiple streams of data
(which
> > just might be adding data at the same instant in time). The other
potential
> > pitfall is that reconstruction often implies "re-running" (e.g.,
> > reconstruction of the data in the same order/timeframe). Fear this!
> >
> > So now we're down to identifying chronological order. Assume that
source A
> > has data with timestamp 10:22:01 (ignoring the date portion for
simplicity)
> > and source B has data with the same timestamp (you said this was
possible).
> > They both get inserted into the DB (regardless of table) at roughly the
same
> > time. Based on data alone, it is not possible to determine which is
first.
> > What does the DB have to assist? You could use a timestamp for the
table
> > (or tables) and rely on the current implementation to derive order.
Somone
> > recently posted that this type of solution was working. You could use a
> > datetime column to mark each row with the datetime of insert. This
approach
> > may suffer due to accuracy limitations. Lastly, you could use a single
> > table with an identity. This should logically work (and it is what you
> > considered) but may be problematic due to contention / locking.
Hotspots
> > will definitely be something to avoid. Note that this approach is also
> > predicated on the immediate insertion of data, implying that every data
> > "event" is recorded on a one-by-one basis. This is not the best
approach in
> > terms of network usage (and does not scale well).
> >
> > You might want to investigate any potential client-side approaches as
well.
> > In a single-threaded application, you could also impose your own serial
> > numbering on the data before insertion.
> >
> > Lastly, you might want to indicate what your ultimate goal is.
Relational
> > databases are often slower than file-based approaches for data of this
type
> > (there is a lot of overhead that you may not need for recording data).
> > There are other ways to record "data" in fifo order that might later to
> > imported into a real database for analysis or reporting. If there are
no
> > real relationships in your data, then perhaps you don't need a rdbms.
> > Without knowing what you intend to do with the information, this is the
> > approach I would investigate first.
> >
> > "Paul" <paulsmith5@.hotmail.com> wrote in message
> > news:ca236fb1.0409220850.2058abc9@.posting.google.com...
> > > Hi,
> > >
> > > Apologies for the vague subject title but I couldn't think of a snappy
> > > title to describe what I am doing. Please bear with me as I explain...
> > >
> > > I am developing an application that records data from several
> > > different sources operating at relatively high rates (e.g. >5 times
> > > per sec). The data from the various sources is diverse, in terms of
> > > the type (e.g. data from source A may comprise of 5 parameters in
> > > binary format, whereas data from source B may comprise of a single
> > > parameter in ascii format). The one thing they have in common is a
> > > timestamp. The timestamp although unique for each source is not unique
> > > amongst all sources. For example although there will be only ever be a
> > > single row in TableA with a particular timestamp representing a
> > > particular point in time, there may also be a row in TableB with the
> > > same timestamp. In an attempt to have the writes as efficient as
> > > possible and to prevent the tables growing too big I record data from
> > > each source to different tables. These tables are created at runtime
> > > before I begin to record the data. Following a period of recording
> > > some tables may still have in excess of 500,000 rows. I now wish to
> > > reconstruct the sequence of events in chronological order, i.e.
> > > retrieve the earliest data recorded from all the sources, followed by
> > > the next and so on. I'm wondering how to approach this. I was thinking
> > > of creating a single large table into which I would insert the
> > > timestamp and ID of every row from each source as well as the table
> > > name, then ceating a clustered index on the timestamp field, so that
> > > the rows would be physically sorted in chronlogical order. This table
> > > may look like the following when complete
> > >
> > > 1 09/22/2004 16:00:00 Table1
> > > 2 09/22/2004 16:00:01 Table1
> > > 1 09/22/2004 16:00:02 Table2
> > > 3 09/22/2004 16:00:03 Table1
> > > 2 09/22/2004 16:00:03 Table2
> > > etc.
> > >
> > > This would only ever have to happen once (I appreciate it may take
> > > some time to construct) - then each time I need to I could simply move
> > > through the table row by row retrieving the ID and table name which I
> > > could then use as parameters in a query that would retrieve the data.
> > > I'd appreciate any feedback on this approach i.e. is it madness! I was
> > > wondering about views etc. but I don't know if these could help at all
> > >
> > > Thanks,
> > >
> > > Paul

Please advise cluster configuration

We have datawarehouse servwer with Active/Active cluster.
One node has 8GB Ram and another node has 12GB.
Right now I have configured for both the nodes the Max.Sql Server Memory to
be 8GB.
Both the nodes are running with windows 2003 SP1and SQL Server 2000 SP4 with
the 8 CPU.
Please advise the best configuration for this.
Thanks.
Best practice is that you keep the Hardware configuration of all your
cluster nodes the same.
Assuming that you already have the /PAE switch in your boot.ini file, I
would recommend that you add 4GB ram to the node with only 8GB ram.
"DKRReddy" <dkrreddy@.hotmail.com> wrote in message
news:%23UPSxwbNHHA.4152@.TK2MSFTNGP06.phx.gbl...
> We have datawarehouse servwer with Active/Active cluster.
> One node has 8GB Ram and another node has 12GB.
> Right now I have configured for both the nodes the Max.Sql Server Memory
to
> be 8GB.
> Both the nodes are running with windows 2003 SP1and SQL Server 2000 SP4
with
> the 8 CPU.
> Please advise the best configuration for this.
> Thanks.
>
|||Here, here to Edwin's recommendations.
Moreover, you did not say if this installation was x86 or IA-64.
If the former, you will need to set AWE enabled for the BPool to be able to
address more than 4 GB and you will want to limit each node to only 1/2 (or
slightly less) than available memory.
If the latter, and you are not running with Lock Pages in Memory, then you
could specify the full memory amount on each node, but you might want to
also specify a minimum memory amount as well. The Itanium build is more
aggressive about acquiring the minimum memory setting and will cause the
other instance to give up excess memory more readily.
The reason is that in a multi-instanced configuration, there will be times
when you will need or have to have multiple instances running on a single
node, and you will need available resources for each.
Sincerely,
Anthony Thomas

"Edwin vMierlo" <EdwinvMierlo@.discussions.microsoft.com> wrote in message
news:eyyfUfiNHHA.4720@.TK2MSFTNGP03.phx.gbl...
> Best practice is that you keep the Hardware configuration of all your
> cluster nodes the same.
> Assuming that you already have the /PAE switch in your boot.ini file, I
> would recommend that you add 4GB ram to the node with only 8GB ram.
>
> "DKRReddy" <dkrreddy@.hotmail.com> wrote in message
> news:%23UPSxwbNHHA.4152@.TK2MSFTNGP06.phx.gbl...
> to
> with
>
sql

Please advise

Tab1 and Tab2 has the following info.ID column in Tab1 and Tab2 has
matching values.
Tab3 should have the info as below.
Tab1
--
ID Val1 Val2
1 qqq sa
2 aaa fa
3 ddd we
Tab2
--
ID F1
1 A
1 B
1 C
1 D
2 F
2 G
3 H
Output Should be as blelow, without using the functions please advise the
sql query.
Tab3
--
ID Val1 Val2 F1
1 qqq sa A,B,C,D
2 aaa fa F,G
3 ddd we H
Thanks in advance.See: http://www.aspfaq.com/show.asp?id=2529
Razvan|||See: http://www.aspfaq.com/show.asp?id=2529
Razvan

Friday, March 9, 2012

PL/SQL versus stored procedures

I want to know what's the differences between PL/SQL and stored
procedures,
the followings are my analysis, please comment and advise.
1) PL/SQL is Oracle specific, stored procedures are supported in
Oracle, MS-SQL Server, or other databases.
2) PL/SQL has 2 types: procedures and functions
3) PL/SQL procedure = stored procedure '
4) Oracle stored procedure and MS-SQL stored procedure have
different syntax. I think they are slightly different, I could
find the syntax for Oracle stored procedure, but not MS-SQL stored
procedure. In other words, can we put MS-SQL stored procedure
and put in Oracle without any changes?
Please advise. thanks!!On 13 Oct 2005 22:15:44 -0700, apngss@.yahoo.com wrote:

>I want to know what's the differences between PL/SQL and stored
>procedures,
>the followings are my analysis, please comment and advise.
>1) PL/SQL is Oracle specific, stored procedures are supported in
>Oracle, MS-SQL Server, or other databases.
>2) PL/SQL has 2 types: procedures and functions
>3) PL/SQL procedure = stored procedure '
>4) Oracle stored procedure and MS-SQL stored procedure have
>different syntax. I think they are slightly different, I could
>find the syntax for Oracle stored procedure, but not MS-SQL stored
>procedure. In other words, can we put MS-SQL stored procedure
>and put in Oracle without any changes?
>Please advise. thanks!!
1 PL/SQL is Oracle's language to implement stored procedures, T-SQL is
MS language to implement stored procedures. T-SQL is only supported in
MS and maybe Sybase. 'Stored procedure' is a *concept*, not a
*language*
2 Like any proper procedural language
3 PL/SQL can be used for anonymous blocks : ie code which is not
stored, and for procedures/functions/packages which are stored
4 the syntax for T-SQL and Pl/SQL is akin, but dissimilar.
T-SQL procedures won't work in Oracle and vice versa, moreover Oracle
works completely different, and too many people mistakenly think
Oracle is sqlserver sold by a different vendor. It is not, it works
completely different.
Sybrand Bakker, Senior Oracle DBA|||PL/SQL is to Oracle as T-SQL is to SQL Server. Both have their programming
constructs and data structures. You can "implement" stored procedures using
PL/SQL much like you can do the same with T-SQL.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
<apngss@.yahoo.com> wrote in message
news:1129266944.512419.283400@.o13g2000cwo.googlegroups.com...
>I want to know what's the differences between PL/SQL and stored
> procedures,
> the followings are my analysis, please comment and advise.
> 1) PL/SQL is Oracle specific, stored procedures are supported in
> Oracle, MS-SQL Server, or other databases.
> 2) PL/SQL has 2 types: procedures and functions
> 3) PL/SQL procedure = stored procedure '
> 4) Oracle stored procedure and MS-SQL stored procedure have
> different syntax. I think they are slightly different, I could
> find the syntax for Oracle stored procedure, but not MS-SQL stored
> procedure. In other words, can we put MS-SQL stored procedure
> and put in Oracle without any changes?
> Please advise. thanks!!
>|||apngss@.yahoo.com wrote:
> I want to know what's the differences between PL/SQL and stored
> procedures,
> the followings are my analysis, please comment and advise.
> 1) PL/SQL is Oracle specific, stored procedures are supported in
> Oracle, MS-SQL Server, or other databases.
> 2) PL/SQL has 2 types: procedures and functions
> 3) PL/SQL procedure = stored procedure '
> 4) Oracle stored procedure and MS-SQL stored procedure have
> different syntax. I think they are slightly different, I could
> find the syntax for Oracle stored procedure, but not MS-SQL stored
> procedure. In other words, can we put MS-SQL stored procedure
> and put in Oracle without any changes?
PL/SQL = name of a Oracle's embedded programming language (based on
another programming language called ADA). PL/SQL is also very similar
in syntax and structure to Pascal.
PL/SQL programs can be :
- procedures
- functions
- packages (program units containing both procedures and packages,
similar to a Pascal unit)
- anonymous code block
As procedures, functions and packages are stored (in source code and
pre-compiled format) inside the database, these are often collectively
refered to as "stored procedures".
Anonymous blocks are PL/SQL code blocks constructed by the client and
transmitted to Oracle. Oracle parses and compiles these and then
execute them. These are obviously not stored in the database and
therefore not considers as "stored procedures".
Other databases implements their own embedded programming languages.
SQL-Server's is called Transact-SQL (or simply T-SQL).
Why not simple use SQL? SQL is not Turing Complete and despite its
power and flexibility, lacks at doing complex structural processing.
Thus most databases implement an embedded programming language, which
they tightly integrate with their SQL engine - providing seamless SQL
access from within this embedded language. Note that not all databases
have embedded programming language - some only recently started doing
this (like mySQL).
Embedded programming language look similar. So yes, there are
similarities between T-SQL and PL/SQL. But these are very superficial.
PL/SQL is a formal declarative procedural language with
object-orientated features. It is capable of doing what you can do in
other languages, like Java, C/C++, Delphi/Pascal, Visual Basic, etc.
(besides, Oracle and SQL-Sever work conceptually very different and
what is "good practise" in one database, is a performance killer in the
other)
There are limitations in PL/SQL however. It is a server-side language.
It thus lacks I/O devices such as screen, keyboard, mouse, printer and
so on. It is not an interactive language (it cannot interact with the
end-user). As it is embedded in a database it cannot natively access
the operating system kernel API. Etc.
However, these "limitations" are common to embedded languages. The
advantage is that PL/SQL can be run on any Oracle database on any
platform. Thus you can develop a PL/SQL application on Windows in
Oracle and have a customer use your application in their Oracle
database on an IBM mainframe. Similar to Java, it is fully portable
across Oracle platforms. Unlike Java, it is not an issue of
write-once-and-debug-everywhere as the PL/SQL engine is consistant.
Oracle's Replicator is written in PL/SQL. Oracle Applications (a
commercial product suite) consists of over 1 million lines of PL/SQL
source code. I myself, has written numerous server-side systems
(including a custom replicator and web applicatiom tiers) in PL/SQL. It
is a very capable language - and, as a statement of fact, the *best*
programming language to use when dealing with Oracle data.
Billy|||Good Explanation Billy
Madhivanan|||That was a very good explanation. Thank you.
Ivy