I have two problems I need some help with.
First, I've just inherited a system and am delving into a few timeout
problems that are causing problems for the users.
Now, if I do a simple select * from the table (which looks to be the
cause of the problem at this stage) in QA, I get the results back in
less than a second. If I open the table in EM it takes about 10. Is
there a difference in viewing the data this way ? I'm used to EM being
virtually the same speed. There is only one row. Minor question
really, just something I'd like to understand if there is a
difference.
CREATE TABLE [QUERY] (
[QUERY_ID] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
[CAT_ID] [numeric](18, 0) NOT NULL ,
[QUERY_DESCR] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
[USER_NAME] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
[USER_ID] [int] NOT NULL ,
[IND_EURO] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
CONSTRAINT [DF_QUERY_IND_EURO] DEFAULT ('N'),
[IND_DGCOLUMNS] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL CONSTRAINT [DF_QUERY_IND_DGCOLUMNS] DEFAULT ('N'),
[NO_GROUPS] [int] NOT NULL CONSTRAINT [DF_QUERY_NO_GROUPS] DEFAULT
(0),
[NO_FIELDS] [int] NOT NULL CONSTRAINT [DF_QUERY_NO_FIELDS] DEFAULT
(0),
[NO_LINES] [int] NOT NULL CONSTRAINT [DF_QUERY_NO_LINES] DEFAULT (0),
CONSTRAINT [PK_QUERY] PRIMARY KEY CLUSTERED
(
[QUERY_ID]
) WITH FILLFACTOR = 90 ON [PRIMARY] ,
CONSTRAINT [FK_QUERY_QUERY_CATEGORY] FOREIGN KEY
(
[CAT_ID]
) REFERENCES [QUERY_CATEGORY] (
[CAT_ID]
) ON DELETE CASCADE ON UPDATE CASCADE
) ON [PRIMARY]
GO
I don't think any re-indexing has been done on this (or the other
tables in the db). I was wondering if constant adding/deleting rows
could cause the index to be massive and in need of a good clear out.
Any pointers would be appreciated. From what I can tell, there was
some problems trying to get replication to work. I need to dig deeper
to see if this is now correct.
-------------------------
Secondly, there is a another table in the same database.
CREATE TABLE [FIELD_DATA] (
[ID] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
[DATA_ID] [numeric](18, 0) NOT NULL ,
[FIELD_ID] [numeric](18, 0) NULL ,
[FIELD_CODE] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
[FIELD_VALUE] [numeric](15, 5) NULL ,
CONSTRAINT [PK_FIELDDATA] PRIMARY KEY CLUSTERED
(
[ID]
) WITH FILLFACTOR = 90 ON [PRIMARY]
) ON [PRIMARY]
GO
It holds approx 4 million rows. The rest of the tables have minimal
data and about the same amount (consider them the same if you will).
Now, another 'copy' of this database is held elsewhere (different
client data) and this holds 40 million rows. The difference is that
the first DB is 4.5GB and the second 6.5GB (approx). Does this prove
my theory that re-indexing would be a good idea ?
Thanks
Ryan 3 1306
There are reasons why EM would be slow. The overhead of the GUI and its
locking strategy are two reasons.
Why on earth would you want to create indexes to optimize opening a
table in Enterprise Manager? EM isn't intended as an end user tool and
IMO should never be used to open tables on production systems. Your
goal should be to optimize real queries that you use in production and
they would surely not include "SELECT * FROM table" (!).
--
David Portas
SQL Server MVP
--
David,
Sorry, probably wasn't clear. I don't want to create any more indexes,
nor would I use EM for production purposes. I would probably even
question the indexes that there are at the moment with the data it
holds currently. It was only a small question on that part about seeing
if there was a difference, mainly to confirm my suspicions about a
re-build of the indexes being needed. If it could be GUI only, then I
can ignore it, but if there is a difference in locking strategy, is
this relevant, if so, where can I look for more info ? Is the delay
nothing to do with my suspicions on indexes ? Not overly important if I
don't find the answer to this, but just nice to know if there is a
difference in returning the data (ignoring the GUI).
One part I had spotted was that it was very slow for something
relatively simple IMHO. Other tables in the db aren't a problem.
Quite correct about select *, however whilst trying to look at
something with 'disposable' code (from a development point of view)
which I will likely bin after a few seconds, there is nothing wrong
with this if I am having a quick glance at the data. I wouldn't put
this in a user system. If I'm honest, what they have developed I would
do differently, but I've only just inherited this a few days ago and
was looking to confirm my suspicions.
My main concern is with the indexes and the size they take up.
Ryan
If you're not using EM in production then I wouldn't worry about the
performance of opening a table there. EM is a pain in lots of ways and
poor performance is just one of them.
Based on what you said about the relative sizes of your two DBs you
should check DBCC SHOWCONTIG to see if a REINDEX is in order. More info
here: http://www.microsoft.com/technet/pro.../ss2kidbp.mspx
--
David Portas
SQL Server MVP
-- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Doug |
last post by:
Hi all. Have a SQL server with about 10 small databases on it. One database
in particular, the tables are somehow being recreated each night at 12:03
AM. The tables are also empty of data. There's...
|
by: btober |
last post by:
Whenever I create a temporary table, with something like
CREATE TEMPORARY TABLE temptable1 AS SELECT * FROM paid.ad_hoc_query;
New schemas appear, with names like "pg_temp_1". I guess the...
|
by: b b |
last post by:
I created the following code to delete all linked tables in my database
(Access 200):
--------------------------------------------------------
Dim tbl As TableDef
Dim dbs As Database
Set dbs...
|
by: cmcmillan |
last post by:
Hello folks. I have a database with about 10 users. On startup of the
front end (Which holds some tables, macros, forms) I am running a macro
that deletes a couple tables and imports replacements...
|
by: mircu |
last post by:
Hi,
I need a quick solution to make my application behave correctly when one
of these timeouts occurs. I have some logic in session_start but when
the authentication cookie timeouts the user is...
|
by: JThomas |
last post by:
Hello!
I'm having trouble with a page apparently causing my client's Safari
browser to time out. I don't actually have access to a Mac & Safari,
and haven't been able to physically see this...
|
by: metoikos |
last post by:
I've scoured the web (clumsily, I'm sure) for information on the
difficulties I am having, checked my markup in validators, and had a
friend with more CSS clue look over it, but I haven't had any...
|
by: nyathancha |
last post by:
Hi,
I have a question regarding best practices in database design. In a
relational database, is it wise/necessary to sometimes create tables
that are not related to other tables through a...
|
by: brstowe |
last post by:
Firstly I consider myself quite an experienced SQL Server user, and
am
now using SQL Server 2005 Express for the main backend of my
software.
My problem is thus: The boss needs to run reports;...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
| |