If I were to do it this way (display data after being queried), there's no
guarantee that a user will not create a query that returns 500,000
records.
Since this is address data (each record is a physical,PO Box, residential
address) and the user decides he/she wants to view all the possible
addresses in NY, this query would return at least 500K addresses for the
user to view. The user may only look at 5 addresses but the 500k records
would still need to be there. That's where I'd need to create some other
way
to query the table by telling it that, of the 500K records that the
initial
query affects, only return records 1-100 (first 100) to the datatable.
When
the user scrolls, or does a page down, run a query saying to bring in the
next 100 records (101-200) of the initial 500K query, and so on.
I know I'm exagerating a bit because most tables will contain 300K-500K of
addresses for a state, but the user, as impossible as it may be, may want
to
look at all the records.
What would you guys suggest?
in
message news:
[email protected]...
I have to ask, what human can possibly process 500K records at one time?
Think of things like paging, etc, etc, to cut down on the result set and
then display that. I would definitely say that this is the kind of scenario
where some out of the box thinking would be a good thing.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
VMI said:
But there may be a possibility that a certain query will return 500K
records. In that case, I'd need to load those 500K records into the table.
"Lateralus [MCAD]" <dnorm252_at_yahoo.com> wrote in message
I think you may want to take another approach. Are there any fields
you
can
filter on? For instance you may have a foreign key to a lookup type
table.
I
would suggest making some sort of a "search" type of screen and filter
your
records that way. Just dynamically build a SQL statement using the search
criteria for your where clause, that will help slim down your list. If
your
data is not normalized this may be a bit difficult. You can page your
results with a DataGrid in ASP.Net, but I don't think you can with
winforms.
HTH
--
Lateralus [MCAD]
Thanks for your replies.
We were initially working with 10,000-15,000 records and we never
imagined
that these records would reach 1 million, so it's really something
we
didn't
think through very well (aka a design flaw).
We've already migrated the data to database but we don't exactly
know
how
to
query the database everytime the user does a scroll (or page up/page
down)
in the grid. What event should we capture in order to query the DB
again
and
fill the table? Also, I assume we need to create a Select statement
that
will display the next N records once the user has reached the last
visible
record in the grid/datatable (in pseudocode: "Select the next N records
from
table following the last record displayed"). That's what we haven't
been
able to figure out.
Any help is appreciated.
We have this huge application that's based on storing tons of data on
a
dataTable. The only problem we're having is that storing LOTS of data
(1
million records) into a datatable will slow down the system since all
this
data will be stored in memory. The performance is really affected with
this.
Since we don't really want to redesign everything based on this
datatable,
are there any companies that offer a product similar to the datatable
that
stores lots of data in a more efficient way? Basically, we load all
this
data (it's a one-shot process) into the datatable and work with that.
We
don't want to change any of that; we just want something similar to
the
datatable that stores a better way. Also, the windows datagrid should
be
able to bind to this new table without many problems.
Thanks.