473,772 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which gain better performance : multiple columns or use SQL built-in function?

Hi all,
I have 1 table which need to store 7 days data in a row, I not sure
which table design will gain better performance in SELECT statement.
Desgin 1. 7 columns (day1, ..., day7) with char(4)
or
Desgin 2. 1 column (day_1_to_7) with char(28); to retrieve the data,
use substr function

Plz advise.
Thanks!
Whitepaper
Nov 12 '05 #1
1 1533
Though it depends on your application, my thought is that your Design
1 will perform better and easy to maintain .. Design 1 will eliminate
the overhead of SUBSTR function

Cheers
Sathyaram
www.db2click.com


wh***********@y ahoo.com.tw (Jason) wrote in message news:<53******* *************** ****@posting.go ogle.com>...
Hi all,
I have 1 table which need to store 7 days data in a row, I not sure
which table design will gain better performance in SELECT statement.
Desgin 1. 7 columns (day1, ..., day7) with char(4)
or
Desgin 2. 1 column (day_1_to_7) with char(28); to retrieve the data,
use substr function

Plz advise.
Thanks!
Whitepaper

Nov 12 '05 #2

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

Similar topics

2
3307
by: Tom | last post by:
How much of a performance gain can you get from precompiling your RE's.
5
3307
by: Ben Long | last post by:
Hi All, A partner of mine has been charged with identifying a performance / load problem currently experienced on one of our websites. I'm thinking it may be a combination of HTML formatting and syntax along with the number of images (<img> tags) being used on a single page. The problems seem to persist around IE (5.0+ on multiple win OS), however FF 1.0 sometimes chokes but usually clears once the images are loaded.
3
1292
by: Ray Greene | last post by:
SQL newbie alert... I have a table with the fields Location, MachineName ,Hours and Date. (The actual database is more complex but it will do for the purposes of this post) I want to return Location, MachineName and the sum of the hours between two dates. Here is an idea of what I need, although obviously this code doesn't work.
2
2801
by: Wayne Wengert | last post by:
I have an XML document (see below) in which I have a <COMPANY> element that, in turn, contains other elements. Based on an example I saw somewhere I coded it as shown in the sample. In purusing other posts and books I see alternatives such as: <COMPANY name="My Comapny Name <City>Podunk</City> ................. and another alternative:
4
1739
by: Cezar | last post by:
Hi, I need to display the content of an ArrayList on multiple columns, like data1 data2 data3 data4 data5 data6 data7 data8 ---- or data1 data3 data5 data7
2
2435
by: Harvey, Allan AC | last post by:
Hi all, I was hoping someone might be able to set me straight so that I can get some select performance improvements. The table in question has several thousand rows currently, planning several million, it has a date time stamp column. All selects will be on ranges of the date time column. I created an index on the dt column, ran ANALYSE then, EXPLAIN for some queries.
15
3195
by: Rob Meade | last post by:
Hi all, I have a databse which I'm pulling the data from for my ASP page. I have 4 tables, Course, Feature, Objective, and PreRequisite. The last three all contain a course product code and a text column - the course product code links the row(s) to the Course table. So, I might have 1 entry in Course, but perhaps 3 in Feature, 5 in Objective and 2 in PreRequisite.
1
21142
by: Hetal | last post by:
Hi... We are on Visual Basic .NET 2003 and i am using DataView to sort the DataTable. However, we are facing problems with sorting the data based on multiple columns. The below statement to sort the table based on 1 column works perfectly fine. dvShiftData is a DataView
2
1762
by: william.david.anderson | last post by:
Hi there, I'm thinking of using a PREPARE statement inside a stored procedure, but am wondering about the performance penalty associated with calling PREPARE multiple times. Below is an example of the kind of statements I was thinking of using.
3
1324
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I have built an application containing a few projects (nothing that I have written)and there are a few compiler warnings (obsolete methods and the like). Does anyone know if these obsolete methods cause any performance issues if not corrected? I would imagine that they do, but would be interested to know to what extent.
0
9621
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
9454
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
10264
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...
1
10039
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
9914
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6716
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
5355
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
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2851
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.