Improve Performance by Reducing Column Size

During design time, you generally allocate some space to the columns by default. When it comes to tweaking performance, you may try to go back to the design and reduce column size in order to save memory space. This method is just not possible in most tables that contain data. Here’s a trick for reducing column size:

 DESC EMPLOYEE Name                            Null?    Type ------------------------------- -------- ---- EMPNO                           NOT NULL NUMBER(4) ENAME                                    VARCHAR2(100) JOB                                      VARCHAR2(10) MGRID                                    NUMBER(4) JOINDATE                                 DATE DEPTID                                   NUMBER(2)

The following code reduces the size of the column ENAME from 100 to 50.

drop table TEMP_TABLE;create table TEMP_TABLE as select rowid rowid_xx, ENAME from EMPLOYEE;create index TEMP_TABLE on TEMP_TABLE (rowid_xx);alter table EMPLOYEE modify (ENAME NULL);update      EMPLOYEE    set  ENAME = NULL;alter table EMPLOYEE modify (ENAME VARCHAR2(50));update      EMPLOYEE    set  ENAME = (     select ENAME from TEMP_TABLE where rowid_xx = EMPLOYEE.rowid);drop table TEMP_TABLE;
Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may