Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Which is more costly, to create a new table or alter current table in postgresql?

I have Table(table_1) has one column "column_1" as primary key and I need to : 1. add 3 other columns (column_2: serial, column_3 : integer , column_4 :Date) 2. Drop current Primary Key Constraint My Question is : Which is better (DB performance, Best Practices ) create new table or Alter Current table ?

user-image
Question added by Khadijah Shtayat , Technical Lead , Opensooq
Date Posted: 2013/04/02
Muhammd Saif uddin
by Muhammd Saif uddin , Sr. Software Engineer (Mobile) , systemsltd.com

I would suggest doing Alter makes your life easy instead of creating again.
I believe DB performance cannot achieve by doing create or alter table but by indexing which improves the speed of data retrieval operations on tables.
[Reference] http://en.wikipedia.org/wiki/Database_index

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.