473,503 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Indexing to prevent timeout expired message

sorry for posting a question that has probably been posted hundreds of
times, but i can't seem to find the answer i need...We're using a Sql
Server 7.0 database and recently started getting timeout expired
errors on our views, which i'm assuming is due to the volume of
records in our tables. Unfortunately i'm not too experiences w/
indexing tables, so my question is:
1) how do you determine which fields to index (does it have to be a
field w/ no nulls, no duplicates..similar to primary key), and why not
index the primary key
2) is it better to index the same field on different tables, or is it
a better design to index a different field for each table (ex. do you
want to index the same field that you link the different tables with,
or do you want to avoid doing this)
3) can somebody explain the concept of creating a clustered index
4) once table is indexed, if there are users accessing the linked
tables via Access, do they have to re-link the tables?

sorry for the number of questions and what may appear to be simple
questions to most, but again, i'm pretty unfamiliar w/ indexing and
would really appreciate any help...thanks
Jul 20 '05 #1
1 5162

"Danny" <da*****@mindspring.com> wrote in message
news:35**************************@posting.google.c om...
sorry for posting a question that has probably been posted hundreds of
times, but i can't seem to find the answer i need...We're using a Sql
Server 7.0 database and recently started getting timeout expired
errors on our views, which i'm assuming is due to the volume of
records in our tables. Unfortunately i'm not too experiences w/
indexing tables, so my question is:
1) how do you determine which fields to index (does it have to be a
field w/ no nulls, no duplicates..similar to primary key), and why not
index the primary key
2) is it better to index the same field on different tables, or is it
a better design to index a different field for each table (ex. do you
want to index the same field that you link the different tables with,
or do you want to avoid doing this)
3) can somebody explain the concept of creating a clustered index
4) once table is indexed, if there are users accessing the linked
tables via Access, do they have to re-link the tables?

sorry for the number of questions and what may appear to be simple
questions to most, but again, i'm pretty unfamiliar w/ indexing and
would really appreciate any help...thanks


Indexing is big topic, and critical for performance, so I suggest you start
looking into the Books Online documentation on indexes and performance
tuning. You can find a lot of information on the web, too. One quick way to
get going would be to use the Index Tuning Wizard to recommend where you
should place indexes.

As for your questions above, here are some brief answers (which contain
plenty of over-simplification and over-generalization):

1. Look at the columns in the WHERE clauses of your queries. You can index
any column (except bit or computed columns in SQL7), or a combination of
columns. Adding more indexes to a table generally makes SELECTs faster, but
INSERT/UPDATEs slower.

2. Index the appropriate columns on each table - columns used in joins are
almost always worth indexing.

3. In a clustered index, the table data is sorted in the order of the index
(the index in fact holds the data), so you can only have one per table (and
most tables should have one). As a general rule, queries returning single
rows don't benefit much from a clustered index; queries returning a range of
rows, or an aggregate of a number of rows will benefit. Note that primary
keys are clustered by default, but this may not be the best choice.

4. Indexing is completely invisible to clients - they have no idea what
indexes, if any, are on the table. The exception would be if you create a
UNIQUE index, and the client performs an INSERT or UPDATE which would
violate the uniqueness. In that case, the client will get an error.

Simon
Jul 20 '05 #2

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

Similar topics

4
3911
by: Paul | last post by:
I sometimes get a timeout error when populating my datagrid, the code is WizardConnection.Open() UpdateCommand.CommandText = "EXECUTE sp_assign_user '" & PhysOffice.SelectedValue & "', '" &...
5
13256
by: Jason | last post by:
Hi all I get the following error when executing a rather intense stored procedure from an ASPX page. I have tried: - Increasing timeouts on IIS 5.0 (all areas that even mention timeout) - use...
2
4560
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
4
4897
by: Nick | last post by:
Hi I am a little stuck. I have a web app which uses cookieless session management. I would like to inform a user when their session has ended but cannot work out how to implement. I thought...
4
4350
by: Nevyn Twyll | last post by:
I've been working on an asp.net application and everything's been great. But suddenly, whether I'm tyring to use a database on my own machine, or on my server, I'm getting a timeout when trying to...
2
430
by: Chakravarti Mukesh | last post by:
Hi all, I have put some queries on the page that takes too much time to execute. Thus at the time of peak load it gives the following error. Server Error in '/ge' Application....
4
13156
by: VB Programmer | last post by:
When I run my ASP.NET 2.0 web app on my dev machine it works perfect. When I precomile it to my web deployment project and then copy the debug files to my web server I get this problem when trying...
0
2020
by: bonita | last post by:
If I add the code for user to download the file (e.g. if(File.Exists(FILE_NAME)){......}), the ASP.NET will give the following timeout error: Timeout expired. The timeout period elapsed prior to...
1
11040
by: Jake K | last post by:
I have a system timer that elapses every 10 seconds and must execute every ten seconds. Basically every 10 seconds I need to insert into a table. The following code, however, causes a "Timeout...
0
7199
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
7076
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...
0
7274
Oralloy
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,...
1
6984
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
7453
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...
0
5576
agi2029
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,...
0
3162
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...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.