æ¤ç´¢æã«ã¯å¤§å¤ãä¸è©±ã«ãªã£ã¦ããã¤ã³ããã¯ã¹ã 使ãããªãã¦ãæå¥ãè¨ããã«æ´æ°ããç¶ããã¤ã³ããã¯ã¹ã ãã£ã¨æ¾ç½®ãã¦éç¨ãã¦ããã¨ãã¤ã®éã«ãè¥å¤§åãã¦ããã¤ã³ããã¯ã¹ã ä»åã¯ããããªã¤ã³ããã¯ã¹ãåæ§ç¯ããéã«æ°ãã¤ãããã¨ãã¾ã¨ãã¦ã¿ã¾ããã ã¾ãã¯ãã¤ã³ããã¯ã¹ãä½æãã¾ãã¯åä½æããããæ¹ã«ã¤ãã¦ç°¡åã«ã CREATE INDEX æ®éã«ã¤ã³ããã¯ã¹ãä½æã ä»ã®ãã©ã³ã¶ã¯ã·ã§ã³ã¯ãã¼ãã«ãèªã¿åããã¨ã¯ã§ãããã対象ãã¼ãã«å ã®è¡ãæ¿å ¥ãæ´æ°ãåé¤ãããã¨ããã¨ã ã¤ã³ããã¯ã¹ä½æãå®äºããã¾ã§ãããã¯ãããã CREATE INDEX CONCURRENTLY æ¿å ¥ãæ´æ°ãåé¤ããããã¯ããªãã¤ã³ããã¯ã¹ã®ä½ææ¹æ³ã ãã¼ãã«ã2åã¹ãã£ã³ããå¿ è¦ããããæ½å¨çã«ãã®ã¤ã³ããã¯ã¹ã使ç¨ããå¯è½æ§ããããå®è¡ä¸ã®ãã¹ã¦ã® ãã©ã³ã¶ã¯ã·ã§ã³ãçµããã¾ã§å¾ æ©ããå¿ è¦ãããã é
以ä¸ã®ï¼ã¹ãããã§ï¼é©åãªã¤ã³ããã¯ã¹ãä½æãï¼SQLãé«éåã§ããã ï¼ï¼ï¼ ããã©ã¼ãã³ã¹ãæ¹åãã¹ãSQLï¼ãããã¯ã«ã©ã ï¼ãç¹å® ï¼ï¼âï¼ï¼ ãã°ãé²è¦§ãï¼å®è¡ç§æ°ã®å¤§ãããã®ãæ½åºããã ï¼ï¼âï¼ï¼ çµ±è¨ãã¼ãã«ãé²è¦§ãï¼ããå©ç¨ããããã¼ãã«ãç¹å®ããã ï¼ï¼ï¼ 該å½SQLã®ãã©ã³ãã³ã¹ããç¢ºèª ï¼ï¼ï¼ 該å½ã«ã©ã ã«å¯¾ãã¦ã¤ã³ããã¯ã¹ãä½æ ï¼ï¼ï¼ ã¤ã³ããã¯ã¹ãä½æããããã¨ãç¢ºèª ï¼ï¼ï¼ SQLã®ãã©ã³ãã³ã¹ããæ¹åããããã¨ãç¢ºèª è£è¶³ â»â ãããã¸ã§ãã¬ã¼ã¿ ã§èªåçæ DBã¯PostgreSQLãæ³å®ã ï¼ï¼ï¼ããã©ã¼ãã³ã¹ãæ¹åãã¹ãSQLï¼ãããã¯ã«ã©ã ï¼ãç¹å® ã¾ãï¼ã¤ã³ããã¯ã¹ãä½æãã¹ãã«ã©ã ãè¦æ¥µããã ãã®æ¹æ³ã¯ï¼ã¤ããã ï¼ï¼âï¼ï¼ãã°ãé²è¦§ãï¼å®è¡ç§æ°ã®å¤§ãããã®ãæ½åºããã SQLã®å®è¡ãã°ãé²è¦§ããã ãã¨ãã°ï¼Ruby on Railsãªãï¼
NTT ãªã¼ãã³ã½ã¼ã¹ã½ããã¦ã§ã¢ã»ã³ã¿ é´æ¨ å¹¸å¸ 4. ç©çããã¯ã¢ãã åè¨äºã§ã¯ pg_dump ã pg_dumpall ãç¨ããè«çããã¯ã¢ãããç´¹ä»ãã¾ãããæ¬ç« ã§ã¯ç©çããã¯ã¢ããã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã pg_dump ãªã©ãå©ç¨ããè«çããã¯ã¢ããã§ã¯ãç¹å®ã®ãã¼ã¿ãã¼ã¹ããã¼ãã«ããããã¯ã¹ãã¼ããªã©ãåå¥ã«ããã¯ã¢ããã§ãã¾ããã ä¸æ¹ãç©çããã¯ã¢ããã¯ãã¼ã¿ãã¼ã¹ã»ã¯ã©ã¹ã¿å ¨ä½ã®ç²åº¦ã§ã®ã¿ããã¯ã¢ããã§ãã¾ãã ç©çããã¯ã¢ããã«ã¯ããªãã©ã¤ã³ã»ããã¯ã¢ããã¨ãªã³ã©ã¤ã³ã»ããã¯ã¢ãããããã¾ãã æ¬ç« ã§ã¯ãããã«ã¤ãã¦è§£èª¬ãã¾ãã 5. ãªãã©ã¤ã³ã»ããã¯ã¢ããã¨ãªã¹ã㢠ãªãã©ã¤ã³ã»ããã¯ã¢ããã¯ãPostgreSQLã®é転ãåæ¢ããããã¼ã¿ãã¼ã¹ã®å 容ãã¾ããã¨ãã®ã¾ã¾ããã¯ã¢ãããããã®ã§ãã æä½ã¯åç´ã§ãããã¯ã¢ãã㯠tar ã rsync ãªã©ã®
ããããã«æ¬¡ã®ãããªãã¼ãã«ãä½ã£ã¦ã¿ãã CREATE TABLE hoge( col1 INT NOT NULL , col2 INT NOT NULL , CONSTRAINT pkey_hoge PRIMARY KEY(col1, col2) ) ; CREATE TABLE foo( col1 INT NOT NULL , col2 INT NOT NULL , col3 INT NOT NULL , col4 INT NOT NULL , CONSTRAINT pkey_foo PRIMARY KEY(col1, col4) , CONSTRAINT uniq1 UNIQUE(col1, col2) , CONSTRAINT uniq2 UNIQUE(col4, col2, col3) , CONSTRAINT ref1 FOREIGN KEY(col1, col4) REFE
ã¡ã³ããã³ã¹
ãç¥ãã
é害
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}