473,394 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Database access and speed

JJ
My question is basically about whether its best to do a small number
database accesses and do most of the data organisation in sql stored
procedures, or one larger fetch from the database and do the database
organisation in the asp.net code:

I am building a menu system for an online store. At the top will be the main
'departments' and on the side will be the sub-departments of whichever main
department is selected, with its sub-sub departments underneath each one.
There will also be a breadcrumb at the top showing the route through the
departments. It lookds something like:
Store/Computing/Computers/Handhelds

Clothes >Computing Home Music
Computers
- Desktops
- Laptops
- >Handhelds

Accessories
- Media
- Cases

Drives
- CD
- DVD
- Hard Disk

The possible issue I may have at the moment is the number of database
accesses per click on an menu item. I though I was being efficient by doing
much of the work of organising the data by using SQL 2005 stored procedures,
but I am wondering whether there's a better way.

Currently, there are 3-4 database accesses to display the above page (1 for
breadcumb, 1 or 2 for sub menu and one for main menu). Ofcourse there will
be another database fetch to display the details of the department selected
in the centre of the page.

Although I am caching as I go along I wonder if it would it be better to get
all the departments (and their decendants) into a dataset and do the
organisation there? i.e. one big fetch instead of lots of little ones??

JJ
Dec 20 '06 #1
4 1288
JJ,

The amount of data you will have is minimal on the client.

Why don't you load all you data to a XML file and then
traverse the XML using a script language.

Funnily enough I am doing the same thing at the moment
to produce a drill down report.

Just an idea.

rotsey
"JJ" <ab*@xyz.comwrote in message
news:u3**************@TK2MSFTNGP04.phx.gbl...
My question is basically about whether its best to do a small number
database accesses and do most of the data organisation in sql stored
procedures, or one larger fetch from the database and do the database
organisation in the asp.net code:

I am building a menu system for an online store. At the top will be the
main 'departments' and on the side will be the sub-departments of
whichever main department is selected, with its sub-sub departments
underneath each one. There will also be a breadcrumb at the top showing
the route through the departments. It lookds something like:
Store/Computing/Computers/Handhelds

Clothes >Computing Home Music
Computers
- Desktops
- Laptops
- >Handhelds

Accessories
- Media
- Cases

Drives
- CD
- DVD
- Hard Disk

The possible issue I may have at the moment is the number of database
accesses per click on an menu item. I though I was being efficient by
doing much of the work of organising the data by using SQL 2005 stored
procedures, but I am wondering whether there's a better way.

Currently, there are 3-4 database accesses to display the above page (1
for breadcumb, 1 or 2 for sub menu and one for main menu). Ofcourse there
will be another database fetch to display the details of the department
selected in the centre of the page.

Although I am caching as I go along I wonder if it would it be better to
get all the departments (and their decendants) into a dataset and do the
organisation there? i.e. one big fetch instead of lots of little ones??

JJ

Dec 20 '06 #2
JJ
Well, I did think of that at first, but all the solutions that I came upon
dealt with using sql stored procedures. It is working at the moment using
recursive SQL statements. But the organisation of such a nested menu system
does seem to point to an XML structure.

I think I did attempt it, but as I am using self referencing tables (ie. one
may be the parent or child of another) I think I got a little confused....

How would you hold the XML file in memory - could you cache it? or would you
actually write to a physical file?

Thanks,

JJ
"Rotsey" <ma***********@RemoveThis.optusnet.com.auwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
JJ,

The amount of data you will have is minimal on the client.

Why don't you load all you data to a XML file and then
traverse the XML using a script language.

Funnily enough I am doing the same thing at the moment
to produce a drill down report.

Just an idea.

rotsey
"JJ" <ab*@xyz.comwrote in message
news:u3**************@TK2MSFTNGP04.phx.gbl...
>My question is basically about whether its best to do a small number
database accesses and do most of the data organisation in sql stored
procedures, or one larger fetch from the database and do the database
organisation in the asp.net code:

I am building a menu system for an online store. At the top will be the
main 'departments' and on the side will be the sub-departments of
whichever main department is selected, with its sub-sub departments
underneath each one. There will also be a breadcrumb at the top showing
the route through the departments. It lookds something like:
Store/Computing/Computers/Handhelds

Clothes >Computing Home Music
Computers
- Desktops
- Laptops
- >Handhelds

Accessories
- Media
- Cases

Drives
- CD
- DVD
- Hard Disk

The possible issue I may have at the moment is the number of database
accesses per click on an menu item. I though I was being efficient by
doing much of the work of organising the data by using SQL 2005 stored
procedures, but I am wondering whether there's a better way.

Currently, there are 3-4 database accesses to display the above page (1
for breadcumb, 1 or 2 for sub menu and one for main menu). Ofcourse there
will be another database fetch to display the details of the department
selected in the centre of the page.

Although I am caching as I go along I wonder if it would it be better to
get all the departments (and their decendants) into a dataset and do the
organisation there? i.e. one big fetch instead of lots of little ones??

JJ


Dec 20 '06 #3
JJ,

You could seriailse your data to memory easily using a memorystream
then to a string and and cache it quite easily in a cache object

The key to what I did was I created class objects in the hierarchy
I wanted the data then used xmlserialiser. That way when
I traversed the XML it would be relatively fast.

Your data model may be a bit more tricky from what you say.
But there is no reason why you could do the same thing but
duplicate any data that your relationships required to keep the
correct hierarchy.
Do you see what I mean?

rotsey

"JJ" <ab*@xyz.comwrote in message
news:eM**************@TK2MSFTNGP06.phx.gbl...
Well, I did think of that at first, but all the solutions that I came upon
dealt with using sql stored procedures. It is working at the moment using
recursive SQL statements. But the organisation of such a nested menu
system does seem to point to an XML structure.

I think I did attempt it, but as I am using self referencing tables (ie.
one may be the parent or child of another) I think I got a little
confused....

How would you hold the XML file in memory - could you cache it? or would
you actually write to a physical file?

Thanks,

JJ
"Rotsey" <ma***********@RemoveThis.optusnet.com.auwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>JJ,

The amount of data you will have is minimal on the client.

Why don't you load all you data to a XML file and then
traverse the XML using a script language.

Funnily enough I am doing the same thing at the moment
to produce a drill down report.

Just an idea.

rotsey
"JJ" <ab*@xyz.comwrote in message
news:u3**************@TK2MSFTNGP04.phx.gbl...
>>My question is basically about whether its best to do a small number
database accesses and do most of the data organisation in sql stored
procedures, or one larger fetch from the database and do the database
organisation in the asp.net code:

I am building a menu system for an online store. At the top will be the
main 'departments' and on the side will be the sub-departments of
whichever main department is selected, with its sub-sub departments
underneath each one. There will also be a breadcrumb at the top showing
the route through the departments. It lookds something like:
Store/Computing/Computers/Handhelds

Clothes >Computing Home Music
Computers
- Desktops
- Laptops
- >Handhelds

Accessories
- Media
- Cases

Drives
- CD
- DVD
- Hard Disk

The possible issue I may have at the moment is the number of database
accesses per click on an menu item. I though I was being efficient by
doing much of the work of organising the data by using SQL 2005 stored
procedures, but I am wondering whether there's a better way.

Currently, there are 3-4 database accesses to display the above page (1
for breadcumb, 1 or 2 for sub menu and one for main menu). Ofcourse
there will be another database fetch to display the details of the
department selected in the centre of the page.

Although I am caching as I go along I wonder if it would it be better to
get all the departments (and their decendants) into a dataset and do the
organisation there? i.e. one big fetch instead of lots of little ones??

JJ



Dec 20 '06 #4
JJ
I think I understand. I have got so far with it before and cached the stream
from the database, but the realtionships are a little tricky, and displaying
the data in nested repeaters was tricky too.

I found lots of examples for two seperate tables and how to relate them in
your dataset, turn them into XML and then use them in repeaters/menu's etc,
but none for self referencing tables.

Think I'll give it a go after Christmas.

Thank you very much for your suggestion,
JJ

"Rotsey" <ma***********@RemoveThis.optusnet.com.auwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
JJ,

You could seriailse your data to memory easily using a memorystream
then to a string and and cache it quite easily in a cache object

The key to what I did was I created class objects in the hierarchy
I wanted the data then used xmlserialiser. That way when
I traversed the XML it would be relatively fast.

Your data model may be a bit more tricky from what you say.
But there is no reason why you could do the same thing but
duplicate any data that your relationships required to keep the
correct hierarchy.
Do you see what I mean?

rotsey

"JJ" <ab*@xyz.comwrote in message
news:eM**************@TK2MSFTNGP06.phx.gbl...
>Well, I did think of that at first, but all the solutions that I came
upon dealt with using sql stored procedures. It is working at the moment
using recursive SQL statements. But the organisation of such a nested
menu system does seem to point to an XML structure.

I think I did attempt it, but as I am using self referencing tables (ie.
one may be the parent or child of another) I think I got a little
confused....

How would you hold the XML file in memory - could you cache it? or would
you actually write to a physical file?

Thanks,

JJ
"Rotsey" <ma***********@RemoveThis.optusnet.com.auwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>>JJ,

The amount of data you will have is minimal on the client.

Why don't you load all you data to a XML file and then
traverse the XML using a script language.

Funnily enough I am doing the same thing at the moment
to produce a drill down report.

Just an idea.

rotsey
"JJ" <ab*@xyz.comwrote in message
news:u3**************@TK2MSFTNGP04.phx.gbl...
My question is basically about whether its best to do a small number
database accesses and do most of the data organisation in sql stored
procedures, or one larger fetch from the database and do the database
organisation in the asp.net code:

I am building a menu system for an online store. At the top will be the
main 'departments' and on the side will be the sub-departments of
whichever main department is selected, with its sub-sub departments
underneath each one. There will also be a breadcrumb at the top showing
the route through the departments. It lookds something like:
Store/Computing/Computers/Handhelds

Clothes >Computing Home Music
Computers
- Desktops
- Laptops
- >Handhelds

Accessories
- Media
- Cases

Drives
- CD
- DVD
- Hard Disk

The possible issue I may have at the moment is the number of database
accesses per click on an menu item. I though I was being efficient by
doing much of the work of organising the data by using SQL 2005 stored
procedures, but I am wondering whether there's a better way.

Currently, there are 3-4 database accesses to display the above page (1
for breadcumb, 1 or 2 for sub menu and one for main menu). Ofcourse
there will be another database fetch to display the details of the
department selected in the centre of the page.

Although I am caching as I go along I wonder if it would it be better
to get all the departments (and their decendants) into a dataset and do
the organisation there? i.e. one big fetch instead of lots of little
ones??

JJ



Dec 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jason | last post by:
I would appreciate some help on how to convert a database table into an html file via FSO and whether more seasoned asp programmers recommned this route. The main reason I am attempting to do this...
0
by: Rob Cheshire | last post by:
Hi to all, I need some help deciding on the best database system for our specific application. OPTIONAL INFO: We currently have 2 separate projects that need to be updated from dos-based dBase. ...
29
by: A.P. Hofstede | last post by:
Could someone tell me where MS-Access (current and 97?) fit(s) on the RDBMS - ORDBMS - ODBMS spectrum? I gather it's relational, but how does it size up against/follow SQL2/3/4 definitions and how...
6
by: Frank Rizzo | last post by:
Hello, I am writing a server that will be inserting/reading/updating the database on multiple threads. I understand that you can't have more than 1 reader open on a database connection. Are...
4
by: RSH | last post by:
Hi, I have a situation where I have created a little application that makes an Access database from a SQL Database for reporting purposes. it does the job well, but it seems a bit slow. Is...
10
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the...
12
by: Matt.W.Stephens | last post by:
Here is the scenario. We have a database with patient case information. This database was previously solely used in Access. The problem is our users connect to this database (located in California)...
1
by: tc | last post by:
Hi. I have a customer who is running our .net application, multiple clients connecting to an Access database. This ONE customer reports a great speed degredation when more than one client is...
2
by: ykhamitkar | last post by:
Hi There, I have some questions about ms access database 1. How much data ms access can handle with good speed. 2. Does the size of column affect the speed of ms access database. (If i...
11
by: JB | last post by:
I'm writing a data driven app, its all just about finished but i havent decided how to store the data. I'm looking at some form of database. Requirements: Easy to Distribute, hopefully just some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.