Q
Problem solve Get help with specific problems with your technologies, process and projects.

# Technical considerations for using NUMBER vs. VARCHAR2

## My question is a continuation of the NUMBER/VARCHAR2 question. You have given functional considerations in your answer. Are there any technical considerations, things like speed of data manipulation or space considerations?

My question is a continuation of the NUMBER/VARCHAR2 question. You have given functional considerations in your answer, which are quite right. Are there any technical considerations, things like speed of data manipulation or space considerations?
The VARCHAR2 datatype will require the number bytes equivalent to the number of characters. If you store five characters, then five bytes are required to store that data, assuming that your characterset is not a multibyte characterset. If you are using a mutlibyte characterset, then it will require 10 bytes. If you store seven characters, then seven bytes (or 14 in a multibyte) are required to store the data.

The NUMBER datatype will use a varying number of bytes as well. There is one byte used to store the exponent and...

one to 20 bytes to store the mantissa of the number. So depending on the number you store, you can use between two to 21 bytes of data.

The above gives you the information you need to decide how much storage space is required to store your number in the NUMBER and VARCHAR2 datatypes. Typically, the NUMBER datatype will require less bytes than the VARCHAR2 datatype unless the value is very small, i.e., one, two, three, etc. In the case where the value is one digit, the VARCHAR2 datatype will require one less byte than the NUMBER datatype. However, in today's systems, the storage requirements are typically not a determining factor here.

In most every case, the performance differences are negligable. The smallest unit of I/O is one database block. Unless you are using a very small block size, you still have to read that one block to read the value no matter which datatype you use, provided the block is not already in the cache. So the performance time spent reading the value is the same. If you are going to perform operations on the value and have to convert the value from one datatype to another, then you will incur CPU cycles for the conversion. For instance, you store the value in a VARCHAR2 and then want to perform arithmetic; that value must be converted to a NUMBER datatype first, either explicitly or implicitly.

However, with today's systems, the CPU cycles required are minimal so as to hardly be noticed. I suppose someone could come up with a scenario where the datatype conversions could make a difference, but I would say that such a case would be very rare in practice.

To me, the biggest influencing factors were outlined in my previous response. I really do not see storage requirements or performance to be the defining criteria, except in the most extreme cases.

This was last published in August 2005

#### Have a question for an expert?

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

#### Start the conversation

Send me notifications when other members comment.

## SearchDataManagement

• ### Hortonworks cloud options grow via Google, Microsoft, IBM

Hortonworks now supports Google Cloud Storage and has also broadened cloud deals with Microsoft and IBM, aiming to increase cloud...

• ### Evolving data integration strategies target new analytics needs

Most companies don't have a shortage of data, but it's often stored in siloed systems or inconsistent formats -- problems that ...

• ### What goes into a customer analytics data integration framework

Customer data integration is a minefield for IT teams to navigate. But incorporating a set of core technical functions into an ...

• ### Data-driven strategy grooms dog care franchise for growth

Camp Bow Wow is growing its day care and boarding business for dogs with the help of a data-driven approach that's powered by a ...

• ### Tableau acquisition of MIT AI startup aims at smarter BI software

Tableau acquires AI startup Empirical Systems in a plan to provide users with automated data modeling capabilities and enable ...

• ### Choosing the right data discovery platform for the enterprise

Obviously, cost and scalability factor into data discovery platform buying decisions, but other features, like visualizations and...

## SearchSAP

• ### Sapphire conference intros raise SAP integration questions

Unveiling of Salesforce challenger C/4HANA and lingering indirect licensing issue give mixed message about SAP's willingness to ...

• ### SAP quietly pulls the plug on SAP Anywhere

Users and analysts say technical limitations and a failure to adequately understand the SMB market contributed to the demise of ...

• ### New tools unveiled to monitor, manage and optimize SAP environments

Vendors announced software to help organizations move to SAP systems, including test automation, code profiling for HANA apps, ...

## SearchSQLServer

• ### Proposed Microsoft-GitHub buy confirms open source role in cloud

The looming Microsoft-GitHub pairing confirms the company's rebirth as an open source friend. Data tools on the Azure cloud are ...

• ### Common Data Service for Analytics eases Power BI integration

Integrating data into Power BI for analysis can be a challenge, but Microsoft's Common Data Service for Analytics technology is ...

• ### Power BI Report Server adds new Power BI reporting options

Updates to Power BI Report Server expand the on-premises platform's reporting functionality and increase the number of data ...

## TheServerSide.com

• ### How to git revert a commit: A simple undo changes example

The best way to undo previous changes to the source code repository is to learn how to git revert a commit.

• ### Jenkins vs. Maven: Compare these build and integration tools

DevOps advocates are often asked for a Jenkins vs. Maven comparison. But those asking often discover that Maven-Jenkins ...

• ### Jenkins environment variables list for shell script build jobs

The Jenkins environment variables list outlines the various properties that developers can inject into advanced Jenkins shell ...

## SearchDataCenter

• ### Why data centers need log management tools

Log files contain rich and useful management data. With the right software tools and a few navigation tips, you can maximize and ...

• ### HPE gives its memory-driven computing initiative another try

HPE has brought its memory-driven computing architecture back into the spotlight, this time with a little help from its friends ...

• ### HPE edge strategy reroutes data, apps around the cloud

HPE's upgraded converged infrastructure systems aim to help enterprises process and manage data outside their data centers and ...

## SearchContentManagement

• ### SharePoint hub sites raises migration questions among users

In the newest rev of SharePoint Online, what used to be sub-sites are now new freestanding sites. This change and others may ...

• ### Cloud DAM platforms vs. on premises for digital asset management

Learn about digital asset management and how cloud DAM democratizes media management and delivery across the enterprise while ...

• ### Box workflow gets upgrade with Progressly purchase

Box is hoping to upgrade its workflow capabilities by adding the startup Progressly to its team, while also still partnering with...

## SearchHRSoftware

• ### News roundup: TriNet software targets professional services

New specialized products include TriNet software for professional services, QuickBooks payroll for contractors and a ...

• ### AI can reduce workplace bias, says CEO of leading HR group

AI technology may help HR reduce workplace bias, according to Johnny Taylor, president and CEO of the Society for Human Resource ...

• ### How to create an effective employee retention plan

The unemployment rate is low, and your workers are likely being courted by other companies. Here's how to create retention ...

Close