Hello!
I developed a web application to display results from the database. Now I
need to add search function, to search, sort and filter data.
My question is, which way is better...
1) Store all related data in a single DataSet and use DataView to filter and
sort data
OR
2) Join related data to a single results set and filter data on the database
side, then store already filtered data in DataSet.
Database structure:
Table "Users" (parent) ~ 5000 records
Table "Orders" (child)
Table "Payments" (child)
I am using MS Access database.
All suggestions are welcome!
Scott 5 1416
Scott,
It's a pretty hard question to answer since it's depend on a lot of factors
we don't know, namely the size of data (I mean, if you have huge text
fields, it's very likely the pure in memory solution won't work) and how
it's use (# of users).
here's what I can tell you:
- Often times there's a 20/80 rule in play where 20% of activity account for
80% of performance implication. If you can identify this 20% and optimize
it (cache) you'll likely hit the right balance.
- See how much memory is used by storing all data in-memory and make sure
you don't come too close to causing an application restart (by default it's
60% of your total RAM))...if you can't store all the data, then this option
won't be an alternative and you'll have answered your own question
- Consider doing a "lazy load". This is similar to the first point, where
you load the most frequent and small data in memory and only go to the
database for the more infrequent stuff. Such an example is with a search
functionally. You might cache the search criterias as well as the id and
name/title to quickly display the result, but go to the database for the
much larger data such as the content/description (this works particularly
well for "result" pages and "detail" pages). Also note, Detail pages can
often make use of OutputCache so you can have your cake and eat it too
- Finally, you mention Access, I'll assume that you don't plan on having
large amounts (or even small amounts) of concurrent users. Much like I
recommend you test how much data you can store to see if you'll exceed the
limit, you'll need to test your databases capability to handle numerous
requests. If it isn't up to the job you'll need to levarage a more
in-memory solution.
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/index.aspx - New and Improved (yes, the popup is
annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Scott Reynolds" <sc***@it-xenius.co.uk> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl... Hello!
I developed a web application to display results from the database. Now I need to add search function, to search, sort and filter data.
My question is, which way is better...
1) Store all related data in a single DataSet and use DataView to filter
and sort data
OR
2) Join related data to a single results set and filter data on the
database side, then store already filtered data in DataSet.
Database structure:
Table "Users" (parent) ~ 5000 records Table "Orders" (child) Table "Payments" (child)
I am using MS Access database.
All suggestions are welcome!
Scott
Scott,
It's a pretty hard question to answer since it's depend on a lot of factors
we don't know, namely the size of data (I mean, if you have huge text
fields, it's very likely the pure in memory solution won't work) and how
it's use (# of users).
here's what I can tell you:
- Often times there's a 20/80 rule in play where 20% of activity account for
80% of performance implication. If you can identify this 20% and optimize
it (cache) you'll likely hit the right balance.
- See how much memory is used by storing all data in-memory and make sure
you don't come too close to causing an application restart (by default it's
60% of your total RAM))...if you can't store all the data, then this option
won't be an alternative and you'll have answered your own question
- Consider doing a "lazy load". This is similar to the first point, where
you load the most frequent and small data in memory and only go to the
database for the more infrequent stuff. Such an example is with a search
functionally. You might cache the search criterias as well as the id and
name/title to quickly display the result, but go to the database for the
much larger data such as the content/description (this works particularly
well for "result" pages and "detail" pages). Also note, Detail pages can
often make use of OutputCache so you can have your cake and eat it too
- Finally, you mention Access, I'll assume that you don't plan on having
large amounts (or even small amounts) of concurrent users. Much like I
recommend you test how much data you can store to see if you'll exceed the
limit, you'll need to test your databases capability to handle numerous
requests. If it isn't up to the job you'll need to levarage a more
in-memory solution.
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/index.aspx - New and Improved (yes, the popup is
annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Scott Reynolds" <sc***@it-xenius.co.uk> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl... Hello!
I developed a web application to display results from the database. Now I need to add search function, to search, sort and filter data.
My question is, which way is better...
1) Store all related data in a single DataSet and use DataView to filter
and sort data
OR
2) Join related data to a single results set and filter data on the
database side, then store already filtered data in DataSet.
Database structure:
Table "Users" (parent) ~ 5000 records Table "Orders" (child) Table "Payments" (child)
I am using MS Access database.
All suggestions are welcome!
Scott
Hello Karl
Thank you for good suggestions.
Although the next question is off this topic, but maybe you could help me
little more...?
Lets say that I would like to display all Sellers who have at least 3
products.... then I must use DataRowView.Cre ateChildView or I can achieve
it?
I am using code below to fill DataSet and create Relations:
.....
myDA = New OleDbDataAdapte r("select * from Users", myConn)
myDA .Fill(myDS, "Users")
myDA = New OleDbDataAdapte r("select * from Payments", myConn)
myDA .Fill(myDS, "Payments")
myDA = New OleDbDataAdapte r("select * from Orders", myConn)
myDA .Fill(myDS, "Orders")
myDS.Relations. Add("Users_Paym entsREL", _
myDS.Tables("Us ers").Columns(" Id"), _
myDS.Tables("Pa yments").Column s("UsersId"), False)
myDS.Relations. Add("Users_Orde rsREL", _
myDS.Tables("Us ers").Columns(" Id"), _
myDS.Tables("Or ders").Columns( "UsersId"), False)
UsersDV = NewBuildDS.Tabl es("Users").Def aultView
myDataGrid.Data Source = UsersDV
myDataGrid.Data Bind()
Regards,
Scott
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Scott, It's a pretty hard question to answer since it's depend on a lot of factors we don't know, namely the size of data (I mean, if you have huge text fields, it's very likely the pure in memory solution won't work) and how it's use (# of users).
here's what I can tell you: - Often times there's a 20/80 rule in play where 20% of activity account for 80% of performance implication. If you can identify this 20% and optimize it (cache) you'll likely hit the right balance. - See how much memory is used by storing all data in-memory and make sure you don't come too close to causing an application restart (by default it's 60% of your total RAM))...if you can't store all the data, then this option won't be an alternative and you'll have answered your own question - Consider doing a "lazy load". This is similar to the first point, where you load the most frequent and small data in memory and only go to the database for the more infrequent stuff. Such an example is with a search functionally. You might cache the search criterias as well as the id and name/title to quickly display the result, but go to the database for the much larger data such as the content/description (this works particularly well for "result" pages and "detail" pages). Also note, Detail pages can often make use of OutputCache so you can have your cake and eat it too - Finally, you mention Access, I'll assume that you don't plan on having large amounts (or even small amounts) of concurrent users. Much like I recommend you test how much data you can store to see if you'll exceed the limit, you'll need to test your databases capability to handle numerous requests. If it isn't up to the job you'll need to levarage a more in-memory solution.
Karl
Hello Karl
Thank you for good suggestions.
Although the next question is off this topic, but maybe you could help me
little more...?
Lets say that I would like to display all Sellers who have at least 3
products.... then I must use DataRowView.Cre ateChildView or I can achieve
it?
I am using code below to fill DataSet and create Relations:
.....
myDA = New OleDbDataAdapte r("select * from Users", myConn)
myDA .Fill(myDS, "Users")
myDA = New OleDbDataAdapte r("select * from Payments", myConn)
myDA .Fill(myDS, "Payments")
myDA = New OleDbDataAdapte r("select * from Orders", myConn)
myDA .Fill(myDS, "Orders")
myDS.Relations. Add("Users_Paym entsREL", _
myDS.Tables("Us ers").Columns(" Id"), _
myDS.Tables("Pa yments").Column s("UsersId"), False)
myDS.Relations. Add("Users_Orde rsREL", _
myDS.Tables("Us ers").Columns(" Id"), _
myDS.Tables("Or ders").Columns( "UsersId"), False)
UsersDV = NewBuildDS.Tabl es("Users").Def aultView
myDataGrid.Data Source = UsersDV
myDataGrid.Data Bind()
Regards,
Scott
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Scott, It's a pretty hard question to answer since it's depend on a lot of factors we don't know, namely the size of data (I mean, if you have huge text fields, it's very likely the pure in memory solution won't work) and how it's use (# of users).
here's what I can tell you: - Often times there's a 20/80 rule in play where 20% of activity account for 80% of performance implication. If you can identify this 20% and optimize it (cache) you'll likely hit the right balance. - See how much memory is used by storing all data in-memory and make sure you don't come too close to causing an application restart (by default it's 60% of your total RAM))...if you can't store all the data, then this option won't be an alternative and you'll have answered your own question - Consider doing a "lazy load". This is similar to the first point, where you load the most frequent and small data in memory and only go to the database for the more infrequent stuff. Such an example is with a search functionally. You might cache the search criterias as well as the id and name/title to quickly display the result, but go to the database for the much larger data such as the content/description (this works particularly well for "result" pages and "detail" pages). Also note, Detail pages can often make use of OutputCache so you can have your cake and eat it too - Finally, you mention Access, I'll assume that you don't plan on having large amounts (or even small amounts) of concurrent users. Much like I recommend you test how much data you can store to see if you'll exceed the limit, you'll need to test your databases capability to handle numerous requests. If it isn't up to the job you'll need to levarage a more in-memory solution.
Karl
To do it in memory you can create a DataView and set the filter
property....i think this is the better solution. Atlernatively, you could
use the SELECT feature of the datatable, but this resutls an array of
datarows which isn't as nice to work with as a dataview..
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/index.aspx - New and Improved (yes, the popup is
annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Scott Reynolds" <sc***@it-xenius.co.uk> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. . Hello Karl
Thank you for good suggestions.
Although the next question is off this topic, but maybe you could help me little more...?
Lets say that I would like to display all Sellers who have at least 3 products.... then I must use DataRowView.Cre ateChildView or I can achieve it?
I am using code below to fill DataSet and create Relations: .... myDA = New OleDbDataAdapte r("select * from Users", myConn) myDA .Fill(myDS, "Users")
myDA = New OleDbDataAdapte r("select * from Payments", myConn) myDA .Fill(myDS, "Payments")
myDA = New OleDbDataAdapte r("select * from Orders", myConn) myDA .Fill(myDS, "Orders")
myDS.Relations. Add("Users_Paym entsREL", _ myDS.Tables("Us ers").Columns(" Id"), _ myDS.Tables("Pa yments").Column s("UsersId"), False)
myDS.Relations. Add("Users_Orde rsREL", _ myDS.Tables("Us ers").Columns(" Id"), _ myDS.Tables("Or ders").Columns( "UsersId"), False)
UsersDV = NewBuildDS.Tabl es("Users").Def aultView
myDataGrid.Data Source = UsersDV myDataGrid.Data Bind()
Regards, Scott
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Scott, It's a pretty hard question to answer since it's depend on a lot of factors we don't know, namely the size of data (I mean, if you have huge text fields, it's very likely the pure in memory solution won't work) and how it's use (# of users).
here's what I can tell you: - Often times there's a 20/80 rule in play where 20% of activity account for 80% of performance implication. If you can identify this 20% and
optimize it (cache) you'll likely hit the right balance. - See how much memory is used by storing all data in-memory and make
sure you don't come too close to causing an application restart (by default it's 60% of your total RAM))...if you can't store all the data, then this option won't be an alternative and you'll have answered your own question - Consider doing a "lazy load". This is similar to the first point, where you load the most frequent and small data in memory and only go to the database for the more infrequent stuff. Such an example is with a
search functionally. You might cache the search criterias as well as the id
and name/title to quickly display the result, but go to the database for the much larger data such as the content/description (this works
particularly well for "result" pages and "detail" pages). Also note, Detail pages
can often make use of OutputCache so you can have your cake and eat it too - Finally, you mention Access, I'll assume that you don't plan on
having large amounts (or even small amounts) of concurrent users. Much like I recommend you test how much data you can store to see if you'll exceed
the limit, you'll need to test your databases capability to handle numerous requests. If it isn't up to the job you'll need to levarage a more in-memory solution.
Karl
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Itai |
last post by:
I need to develop an internal messaging sub-system that is similar to
a web mail application but without SMTP support (e.g message routes
are confined to the webapp domain). The requirements are rather
simple: Each user (e.g mailbox) can view incoming messages and his
outgoing messages. Message quota is defined as the sum of all incoming
and outgoing messages per user
and tracked in the users' row (Users table – log_TotalMessages). The...
|
by: news.onet.pl |
last post by:
I've launched some perfomance test for some program measuring
number of operations, net messages processed per second, etc.
Why is my point, is the question how Java initial and maximal
heap is connected with the swap space of Operating System.
Those Java utilize both memory and swap space for purpose
of its heap?
TIA,
|
by: ml |
last post by:
My employers currently use Access for processing large volumes of data
for reporting and simple modelling, which involves a lot of make
table/update queries etc.
I have been asked to work on a retail forecasting model, but looking at
the spec. the base data tables have approximately 6 million records.
I know this can theoretically be done using Access (Access 97) but in
reality it is extremely slow (even with the necessary tables...
|
by: Scott Reynolds |
last post by:
Hello!
I developed a web application to display results from the database. Now I
need to add search function, to search, sort and filter data.
My question is, which way is better...
1) Store all related data in a single DataSet and use DataView to filter and
sort data
|
by: Jens |
last post by:
I'm starting a project in data mining, and I'm considering Python and
Java as possible platforms.
I'm conserned by performance. Most benchmarks report that Java is
about 10-15 times faster than Python, and my own experiments confirms
this. I could imagine this to become a problem for very large
datasets.
How good is the integration with MySQL in Python?
| |
by: jambalapamba |
last post by:
Hi
I am removing node from a document depending on the style property and this is taking 7 seconds for checking complete document is there any ideas how can i improve the perfomance. Here is my part of code
foreach (IHTMLElement tempElement in document.all)
{
if (tempElement.style.visibility == "hidden" )
{
IHTMLDOMNode node = tempElement as...
|
by: damodharan |
last post by:
Hello and thanks in advance.
I have two table in DB2 (ver 8). table details are
table one(Cust_det) has two fields (Cust_cin and cust_name).
table two(cust_add_det) has cust_cin and cust_address fields.
To join above two table which sql is better on perfomance point of view?
and how conditional where clause works?
|
by: MickJ |
last post by:
Hi,
I would like to write High perfomance server using C#. It would be desirable to hear offers and advices on this subject.
|
by: Aykut Canturk |
last post by:
As all we know there are 2 ways for binding gridview to sql table. using
sqldata adapter and using code. What I want to know is, in large tables, is
there a perfomance difference. When using code we don't specify any page
size or anything. so all data must be retreived from sql table to web server
memory, is that right ? Maybe, only maybe, sql data adapter uses different
approach about loading table rows for perfomance issues.
in VB6,...
|
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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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?
| |