Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Time it takes to access a database
Old 01-27-2006, 07:27 PM Time it takes to access a database
sepple's Avatar
Super Talker

Posts: 147
Trades: 0
Right now I have more than 2000 entries in 12 seperate tables (entries sorted into categories)

The purpose of me making 12 tables instead of 1 giant one was because I was told it was faster to bring up all entries in a table instead of sorting through them. I know that is probably true but on what scale?

Even if I get up to 10,000 entries will it make the pages load that much faster? It would make it a lot easier to sort entries and do things with if they were all in one table.

Thanks in advance!
Stephen
__________________
Thanks
Stephen
sepple is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-28-2006, 10:12 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
absolutely no idea!

It will depend on how the database and tables are structured, simply having the items in seperate tables according to category may actually slow the queries down.

The process is called normalisation and works well if some thought is given to the structure and how to reduce data redundancy and table relationships.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-28-2006, 01:27 PM
sepple's Avatar
Super Talker

Posts: 147
Trades: 0
Do you think it would make that much of a difference? Or are we talking to the point where its not very noticable. Like I said its not like I have millions of entries.
__________________
Thanks
Stephen
sepple is offline
Reply With Quote
View Public Profile
 
Old 01-28-2006, 07:22 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
If each page only makes 1 query then it may not be evident, but it depends on so many other things.

SQL servers are good at optimising how query queues are handled when using join / union queries but with a single monolithic table query it has to be executed at one shot so may be backing up other queries. Also the query construction can make huge differences as well.
For example;
A "SELECT * FROM" could take 30 to 50% longer to execute than a "SELECT fieldlist FROM" simply because the field wildcard (*) means that the table has to be read twice, once to get the field names, and again to get the data from each column.
Another consideration for monolithic vs normalised tables is the data redundancy and how it affects things, such as the storage and the transfer time between SQL server and webserver.
Consider the point of 20,000 records and if each record contains 50 characters of redundant data, that's 1,000,000 characters to be needlessly recovered and transferred. It's also 1,000,000 characters to be stored taking up valuable disk space.
Gaining 40 to 70% speed increases by normalising the structures and optimising queries is not unusual.

Unfortunately too few "developers" understand the DBA side of web development and simply follow the basic SQL tutorials without really understanding the implications of a simplistic design on the code they are developing and you then end up with a system that does not scale up well and performance will degrade rapidly once the system is put under any kind of serious load.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Time it takes to access a database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14127 seconds with 12 queries