Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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 ajoutée par Khadijah Shtayat , Technical Lead , Opensooq
Date de publication: 2013/04/02
Muhammd Saif uddin
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?