J
John Dann
I'd appreciate some general advice on using ado.net in a VB.net
environment for a particular application:
I need to store a large series of instrument-generated data for later
retrieval and analysis and a database (probably Access to start with
for ease-of-development, but maybe a more scalable DBMS later) seems
to offer a number of advantages in being able to retrieve data
flexibly. But because this is a rather different type of application
from most business databases, I'm struggling a little for relevant
advice.
The idea is that new records will be created at defined time intervals
(eg every 10mins, but conceivably as often as every minute) over
potentially long periods of time, eg a year or more. So, in extremis,
we could be looking at a million records or more, though 100 000 might
be more typical. Each record will have its own explicit DateTime stamp
as a column and records will be mostly retrieved by datetime so this
column would be made the primary index. The records will be added to
the database only in strict time sequence, though the processes of
data collection and record creation may be decoupled, ie new data
records created and added potentially in a batch some time after
actual data collection. The database will probably only need to be
queried by one or two users at a time.
That's the background, but a couple of questions, one general and one
specific:
Q1 The general one is whether anyone would disagree with the use of
database such as Access or MSDE for this type of application. I don't
want to get too hung up on the exact choice of database right now.
Provided eg MSDE could do the job ultimately and Access is adequate
for smaller scale prototyping then I can live with that. It's more the
principle of using an established database tool here rather than
creating eg a custom binary file structure and having to explicitly
code the update and query procedures where I'd appreciate any
comments.
Q2 One specific task will be to find out the datetime stamp for the
last record previously added prior to doing the next update of the
database. Not being an experienced database programmer I'm concerned
that the brute force approach to doing this could be very slow. In
other words, if I just ask for the MAX value of the datetime column is
the database going to have to look through all of eg a million records
to find the answer? Or are they cleverer than that and maybe maintain
a separate index of eg min/max values, ie so a column MAX can be
quickly returned?
Or alternatively is there some other way of returning the datetime
column value for the last record previously added?
JGD
environment for a particular application:
I need to store a large series of instrument-generated data for later
retrieval and analysis and a database (probably Access to start with
for ease-of-development, but maybe a more scalable DBMS later) seems
to offer a number of advantages in being able to retrieve data
flexibly. But because this is a rather different type of application
from most business databases, I'm struggling a little for relevant
advice.
The idea is that new records will be created at defined time intervals
(eg every 10mins, but conceivably as often as every minute) over
potentially long periods of time, eg a year or more. So, in extremis,
we could be looking at a million records or more, though 100 000 might
be more typical. Each record will have its own explicit DateTime stamp
as a column and records will be mostly retrieved by datetime so this
column would be made the primary index. The records will be added to
the database only in strict time sequence, though the processes of
data collection and record creation may be decoupled, ie new data
records created and added potentially in a batch some time after
actual data collection. The database will probably only need to be
queried by one or two users at a time.
That's the background, but a couple of questions, one general and one
specific:
Q1 The general one is whether anyone would disagree with the use of
database such as Access or MSDE for this type of application. I don't
want to get too hung up on the exact choice of database right now.
Provided eg MSDE could do the job ultimately and Access is adequate
for smaller scale prototyping then I can live with that. It's more the
principle of using an established database tool here rather than
creating eg a custom binary file structure and having to explicitly
code the update and query procedures where I'd appreciate any
comments.
Q2 One specific task will be to find out the datetime stamp for the
last record previously added prior to doing the next update of the
database. Not being an experienced database programmer I'm concerned
that the brute force approach to doing this could be very slow. In
other words, if I just ask for the MAX value of the datetime column is
the database going to have to look through all of eg a million records
to find the answer? Or are they cleverer than that and maybe maintain
a separate index of eg min/max values, ie so a column MAX can be
quickly returned?
Or alternatively is there some other way of returning the datetime
column value for the last record previously added?
JGD