Welcome to Dream.In.Code
Become an Expert!

Join 149,418 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,262 people online right now. Registration is fast and FREE... Join Now!




Tweaking Database Speed

 
Reply to this topicStart new topic

Tweaking Database Speed

Fygar
1 Jul, 2002 - 01:35 PM
Post #1

I liek milk!!1
Group Icon

Joined: 28 Mar, 2002
Posts: 4,313


Dream Kudos: 50
My Contributions
Alright, I have a database for a web project that is 8gb(!!!!!!!!!) in size. This takes a heck of a long time to search through (around 8 seconds to run a query). Any suggestions to how to cut this time down dramatically? It would be much appreciated. Thanks.
User is offlineProfile CardPM
+Quote Post

Cookie Mobster
RE: Tweaking Database Speed
1 Jul, 2002 - 01:57 PM
Post #2

nooneenooneenooonee
Group Icon

Joined: 12 Oct, 2001
Posts: 4,723



Thanked: 1 times
Dream Kudos: 18
My Contributions
Are you talking one table? without seeing your structure all I can say is to get a faster server...

Cheers Sam
User is offlineProfile CardPM
+Quote Post

RE: Tweaking Database Speed
1 Jul, 2002 - 10:16 PM
Post #3




Joined: --
Posts: 0

LOL Sam,

A few questions:

What kind of data?

Is the database normalized?

Are you using indexes?

Are you searching along the indexed fields?

Indexes add overhead but speed up searches when the search is on the indexed field. If you have only one table and 8gb of data, you probably (not guaranteed) have a design problem.

What platform are you on?

Are your searches pulling back the whole database?

What language are you using to access the db?

H
User is offlinePM
+Quote Post

Fygar
RE: Tweaking Database Speed
2 Jul, 2002 - 06:59 AM
Post #4

I liek milk!!1
Group Icon

Joined: 28 Mar, 2002
Posts: 4,313


Dream Kudos: 50
My Contributions
Hehe, sorry about the lack of detail, I was in a rush yesterday and didn't have time to finish. anyways...

What kind of data?
normal everyday text

Is the database normalized?
meh? lol...

Are you using indexes?
No

Are you searching along the indexed fields?
no

Indexes add overhead but speed up searches when the search is on the indexed field. If you have only one table and 8gb of data, you probably (not guaranteed) have a design problem.

What platform are you on?
SWL Server 2000

Are your searches pulling back the whole database?
no

What language are you using to access the db?
SQL

OK, here's how it works, I have nearly 1000 unique tables, I'm currently pulling data using SQL using Inner Joins; linking around 5 different tables at once. So I'm not pulling the whole database, but it still has to search through a hefty amount, for I am using the largest tables out of the database... seems to take a long time and was just wondering if I can speed it up. And this may sound funny, but I haven't really used indexing before, is this something I should look into? Thanks again....
User is offlineProfile CardPM
+Quote Post

obscurant
RE: Tweaking Database Speed
2 Jul, 2002 - 09:46 AM
Post #5

New D.I.C Head
*

Joined: 2 Jul, 2002
Posts: 2

Yes, use indices. Take a look at the query plan for your slow queries and find out where expensive scans are occurring. Then you can index those columns where you get the most gain. You will want to index the keys on the large tables.

I haven't used sql server 2000 in a while, but I remember it had a query optimizer that would suggest indices. Good to use to get started.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 11:05AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month