473,657 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tables have too many nullable columns

Hi,

I've enherited a big mess, a SQL Server 2000 database with
approximately 50 user tables and 65+ GB data, no explicit
relationships among entities (RI constraints whatsover), attempt to
create an ERD would more than likely kill the relatively complexed
app, the owner would want to drop out of window, so,
I don't intend to do that, you get the picture, sorry no DDLs this
time, and many tables have many nullable columns, joins slows down the
system quite a bit, what's my best bet to improve its performance?
change most of these nullable columns into non-nullable with default
value of something like ' ', any thoughts along this line would be
appreciated.
Jul 20 '05 #1
6 4166
OK. Here's some more detail to the question.
DDL for one critical table (I'll have to search tons of scripts/codes
to find
which ones reference this table):

select left(name,15) colName, isnullable
from syscolumns
where id = object_id('bask etItemBak');

Resultset:
colName isnullable
--------------- -----------
BasketItemID 0
SessionKey 1
ItemID 1
ItemNo 1
ItemName 1
ItemModel 1
ItemManufacture 1
ItemCategory 1
ItemCategoryID 1
Quantity 1
Price 1
ShippingOpt 1
ShippingCost 1
URL 1
DT 1
IP 1
OrderID 1
ExtraInfo 1
myCost 1
ShippingOneItem 1

(20 row(s) affected)

So, the question is, if I turn most of these columns from nullable to
non-nullable would it improve transaction (of this table) to a
noticable degree?
I read somewhere as well Microsoft site yesterday, NULLABLE column
requires "special care" hence hinders performance. What's your
opinion?

And back to the main question, any thing else that is obvious that I
should look into?

Thanks.
qw********@boxf rog.com (Doug Baroter) wrote in message news:<fc******* *************** ****@posting.go ogle.com>...
Hi,

I've enherited a big mess, a SQL Server 2000 database with
approximately 50 user tables and 65+ GB data, no explicit
relationships among entities (RI constraints whatsover), attempt to
create an ERD would more than likely kill the relatively complexed
app, the owner would want to drop out of window, so,
I don't intend to do that, you get the picture, sorry no DDLs this
time, and many tables have many nullable columns, joins slows down the
system quite a bit, what's my best bet to improve its performance?
change most of these nullable columns into non-nullable with default
value of something like ' ', any thoughts along this line would be
appreciated.

Jul 20 '05 #2
In most cases, it is not the data in the datble that poses the problem, but
the query used to extract data from it.

SQL Profiler will help you find out which queries are run the most, and
which ones take up the most CPU time ...

From there, you should look at the best way of improving those individual
queries. NULLable columns may give you a few percentage-points
performance-change m and a minor impact on data-size, but your most likely
cause of problems is likely to be any queries.

Hope this helps.

Steven
Jul 20 '05 #3
Thanks for the idea of using SQL Profiler, unfortunately we don't have
the permission to run it on a hosted-server by our ISP; btw, the
programming logic for the application (not mine) does not look bad but
quite a lot of bugs though. I would humbly think the performance of a
database-driven application depends on at least two critical factors
of db design and method of data manipulation.

"Steven Wilmot" <st*********@wi lmot.me.uk> wrote in message news:<3f******* *************** *@news.aaisp.ne t.uk>...
In most cases, it is not the data in the datble that poses the problem, but
the query used to extract data from it.

SQL Profiler will help you find out which queries are run the most, and
which ones take up the most CPU time ...

From there, you should look at the best way of improving those individual
queries. NULLable columns may give you a few percentage-points
performance-change m and a minor impact on data-size, but your most likely
cause of problems is likely to be any queries.

Hope this helps.

Steven

Jul 20 '05 #4
Erland Sommarskog <so****@algonet .se> wrote in message news:<Xn******* **************@ 127.0.0.1>...
Not being able to run the Profiler, is a severe handicap. If you don't
know what queries that are slow, you cannot fix them. So I would spend
all my energy to resolve this problem, one way or the other. I figured out a workaround (setting timer for blocks of code including
query) for that, downside, consumes more time to do it.
If you cannot
run Profiler at the current host, then try to get a copy of the database
on a machine at home. A while ago, I thought about that, the owner hesitated on my idea.
Now, I'm not interested in doing that.
Changing nullable columns to NOT NULL is not likely to give any significant
performance enhancements. Thanks for your opinion.
More likely is that you add new bugs to the
system.

Entirely possible to add one or two or this sort of range of bugs,
however,
very unlikely to exceed that for a couple of reasons, a) I suppose I
know what I'm doing, b) I took caution in the bug fixing (occasional
oversight).
Jul 20 '05 #5
Just being nosey - but you have trimmed your data types down to just
what you need? The nulls are likely as ES says to cause a headache...

qw********@boxf rog.com (Doug Baroter) wrote in message news:<fc******* *************** ****@posting.go ogle.com>...
Erland Sommarskog <so****@algonet .se> wrote in message news:<Xn******* **************@ 127.0.0.1>...
Changing nullable columns to NOT NULL is not likely to give any significant
performance enhancements.

Thanks for your opinion.
More likely is that you add new bugs to the
system.

Entirely possible to add one or two or this sort of range of bugs,
however,
very unlikely to exceed that for a couple of reasons, a) I suppose I
know what I'm doing, b) I took caution in the bug fixing (occasional
oversight).

Jul 20 '05 #6
Thanks for your input.

Wa******@yahoo. com (WangKhar) wrote in message news:<bb******* *************** ****@posting.go ogle.com>...
Just being nosey - but you have trimmed your data types down to just
what you need? The nulls are likely as ES says to cause a headache...

Jul 20 '05 #7

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

Similar topics

4
4403
by: Greg Ofiesh | last post by:
Anyone who can help, I have two tables T1 and T2. T1 has fields K1 and F2 and T2 has fields K2 and F1. F1 is the foreign key relating to K1 and F2 is the foreign key relating to K2. My initial question has been how can I add a row to both tables with accurate Fx values in one SQL INSERT statement? I have been told it cannot be done.
4
3484
by: jane | last post by:
HI, I try to create summary table like following: create table summary (a int, b int, c int) (select a.aa, b.bb, b.cc from table_a a ,table_b b where a.key=b.key) data initially deferred refresh immediate enable query optimization in tablespace_test replicated;
18
2461
by: Ken Kazinski | last post by:
Does anyone know of a good example for creating a access database and then tables within that database. All the examples I have found so far use a SQL database. Thanks, Ken
12
3626
by: Steven Livingstone | last post by:
I've just blogged some stuff on Nullable types in net 2.0. http://stevenr2.blogspot.com/2006/01/nullable-types-and-null-coalescing.html Question however as to why you can't simply get an implcit conversion from a ..Net value type to to a Sql Server data type rather than having to use null cheked and DBNull.Value ? Does anyone have some explanation as to why this is so tricky as to be included?
0
1399
by: Larry Lard | last post by:
There seems to be something a bit lacking in the way the dataset designer thing deals (or rather doesn't) with nullable fields in VS2005. Maybe it's cos I'm using VB2005 Express (which is variously crippled), I don't know. But it seems to me obvious that there should be some way to specify that DB fields which can be null should be mapped to appropriate Nullable(Of T) generic types. For fields there's a dropdown in the dataset designer...
5
51626
by: GG | last post by:
I am trying to add a nullable datetime column to a datatable fails. I am getting exception DataSet does not support System.Nullable<>. None of these works dtSearchFromData.Columns.Add( new DataColumn( "StartDate", typeof( DateTime? ) ) ); dtSearchFromData.Columns.Add( new DataColumn( "EndDate", typeof( System.Nullable<DateTime>) ) ); Any ideas?
8
3679
by: DaFrizzler | last post by:
Hi, I have received the following email from a colleague, and am quite frankly baffled by the idea. I am just wondering if anyone has any advice or suggestions about this???? === BEGIN MAIL === The DB2 DBA has requested that all columns in the tables be defined as not null with default to improve storage, performance, and ease of
12
7000
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 foreign Key relationship or does this always indicate some sort of underlying design flaw. Something that requires a re evaluation of the problem domain? The reason I ask is because in our application, the user can perform x
1
1424
by: sherifffruitfly | last post by:
Hi all, I'm tasked with adding a few fields to our database, and all of the stuff that goes along with it (updating c# UI code, etc.). The database is a few hundred tables, with all of the procs, logic code, etc. that goes along with it. The consequences (i.e. what breaks) of adding a new field should be largely predictable from the current structure, along with the fields to be added. Anybody know of a tool that will tell me this? Or...
0
8411
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1732
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.