New answers tagged

1

This is what I ended up going with. --==================================================================================================================================================== -- Get tables in Snapshot replication for the selected DB. --===============================================================================================================...


1

Reference: ALTER INDEX (Transact-SQL) Yes you can data compression to this table without dropping the primary key. With keeping all the options you mentioned, following script will compress the table. This script will NOT compress any non-clustered index. ALTER INDEX [PK__t1__3BD0198E286DEFE4] on TABLE [t1] REBUILD WITH (PAD_INDEX = OFF, FILLFACTOR = 100,...


1

Is there a way to apply a data compression to this table without dropping the primary key? Yes you just need to run below command to rebuild the clustered index (in your case it is also PK): ALTER INDEX [PK__t1__3BD0198E286DEFE4] on TABLE [t1] REBUILD with (ONLINE = ON, DATA_COMPRESSION = PAGE) "ONLINE = ON" clause can help greatly reduce locking of ...


1

Columns are toasted individually, so there is no problem with keeping both images in a single table. Only the image that appears in the SELECT list will be detoasted. Moreover, if an UPDATE does not affect the toasted columns, they won't have to be rewritten.


4

Primary key & Foreign key Can I designate that one column of a child to be both a foreign key and also a primary key? Yes absolutely: create table photo ( id integer primary key, ... other columns ... ); create table thumbnail ( id integer primary key references photo, ... other columns ... ); TOAST bytea columns are stored outside ...


Top 50 recent answers are included