ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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
تم إضافة السؤال من قبل Khadijah Shtayat , Technical Lead , Opensooq
تاريخ النشر: 2013/04/02
Muhammd Saif uddin
من قبل 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

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟