ã¯ããã«
ããã«ã¡ã¯ãã¢ã«ããã²ã¼ã ã¹ã®æ²³éã§ãã
å¼ç¤¾ã§ã¯ãã²ã¼ã ã®éç¨ã«ããã¦ãã¬ã¤ã¤ã¼ã®ãã¬ã¤å±¥æ´ãªã©ãBigQueryã«ä¿ç®¡ãã¦ããã¾ãã ã¾ããã®ãã¼ã¿ãç¨ãããã¨ã§ãä¸å ·åã®çºè¦ããããã¬ã¤ã¤ã¼ã楽ãããä¼ç»ãæ©è½éçºã«å½¹ç«ã¦ã¦ããã¾ãã
ä¸æ¹ã§ãé·ãéç¨ãã¦ããä¸ã§ãã®ãããªä¿åã³ã¹ãã®åé¡ã«ããã£ã¦ãããã¨ãããã¾ãã
- ç¹å®ã®ã«ã©ã ã®ãã¼ã¿ãæ´»ç¨ãããªããªã£ã¦ãã
- ã«ãé¢ããã容éãä½TBãä½åTBâ¦ã¨æºã¾ã£ã¦æ¯æã®ä¿åã³ã¹ããé«ãããã£ã¦ãã¾ã£ã¦ãããããè²»ç¨å¯¾å¹æãå ¨ãè¦åã£ã¦ãªã
BigQueryã®å ´åããã¼ãã«ãã¨ãã¼ã¿ãåé¤ããã®ã¯å®¹æã§ããã大éã®ãã¼ã¿ã®å ¥ã£ããã¼ãã«ã®ç¹å®ã®ã«ã©ã ã ããåé¤ãããã¨ãã®å¯¾å¦æ¹æ³ããããããç´¹ä»ããæé ã®ããã«å®ã¯è¤éã«ãªããã¨ãããã¾ãã
æ°è¦ã«ä½æãããéã¯ãã®ãããªæ©ã¿ã«å½ãããªããããè¦ä»¶ãæ³å®å©ç¨éã«å¿ãã¦æå³çã«ãã¼ãã«ãåãããã¨ããªã¹ã¹ã¡ãã¾ãã
⻠以ä¸ã®æ å ±ã¯2024å¹´9æç¾å¨ã®æ å ±ãåºã«ãã¦ãã¾ããå®è¡ã¯2023å¹´ã2024å¹´ååããã«å®è¡ããããããã®å¾å é¨ã®æåãæ§è½ãå¤ãã£ã¦ããå¯è½æ§ããããã¾ãã
使ããªãã£ãæé ï¼ALTER TABLE DROP COLUMN ã使ç¨ãã
BigQueryã«ã¯ã«ã©ã ãåé¤ãããALTER TABLE DROP COLUMNãã¹ãã¼ãã¡ã³ããç¨æããã¦ãã¾ãã
大容éã®ãã¼ãã«ã§ãã»ã¨ãã©ãã¦ã³ã¿ã¤ã ç¡ãå©ç¨ã§ãã¾ããããããã¥ã¡ã³ãä¸ã§ã¯ãã«ã©ã ãåé¤ããã¦ãã¹ãã¬ã¼ã¸ã解æ¾ããããã¨ãä¿éãããã®ã§ã¯ãªããæ¨ãæ¸ããã¦ãã¾ãã
Data definition language (DDL) statements in GoogleSQL  | BigQuery  | Google Cloud
Since DROP COLUMN is not a data cleanup operation, there is no guaranteed time window within which the data will be deleted.
ç§ãã¡ãå®è¡å¾æ°ã¶æã»ã©å¾ ã£ã¦ã¿ã¾ããããè¦ããä¸ã¯ã«ã©ã ãåé¤ããã¦ãã¦ãã¹ãã¬ã¼ã¸ã¯è§£æ¾ããã¾ããã§ããã
ã¾ãå¾ ã£ã¦ããéãåé¤ãããã¯ãã®ã«ã©ã ã¸ã®ã¹ãã¬ã¼ã¸ã³ã¹ããç¶ç¶ãã¦è«æ±ããã¦ãã¾ã£ã¦ããç¶æ³ã§ãããããå¾ ã¤ã®ã諦ãã¦ä»ã®æé ãå©ç¨ãããã¨ã«ãããã¾ããã
å®éã«å®è¡ããæé
代ããã«ç§ãã¡ã®ããã¸ã§ã¯ãã§ã¯ããSELECT * EXCEPT ã¯ã¨ãªãç¨ãã¦ãã¼ãã«ãä¸æ¸ããããã¨ããæä½ãå©ç¨ãããã¨ã«ãã¾ããã å ç¨ã®ããã¥ã¡ã³ãã«ã1çªç®ã®æ¹æ³ã¨ãã¦ç´¹ä»ããã¦ãã¾ãã
There are two options for immediately reclaiming storage:
ã»Overwrite a table with a SELECT * EXCEPT query.
ã»Export the data to Cloud Storage, delete the unwanted columns, and then load the data into a new table with the correct schema.
æé 1ï¼è©²å½ãã¼ãã«ã¸ã®ã¬ã³ã¼ãã®æ¿å ¥ãåæ¢ããã
ç§ãã¡ã試ããçµæã§ã¯ãã¼ãã«ã®ä¸æ¸ããçºçãã¦ããæéä¸ã«æ¿å ¥ãããã¬ã³ã¼ãã«ã¤ãã¦ã¯ãä¸æ¸ããããå¾ã«ã¯åæ ããã¦ãã¾ããã§ããã
ãã®ããã¡ã³ããã³ã¹ã«å ¥ãããããã¯æ¿å ¥äºå®ã®ãã¼ã¿ãä¸æçã«å¥ã®å ´æã«éé¿ãããªã©ããªãã¬ã¤ã¹å¯¾è±¡ã®ãã¼ãã«ã¸ã®ã¬ã³ã¼ãã®æ¿å ¥ãæ¢ããå¿ è¦ãããã¾ãã
æé 2ï¼BigQueryã®ã¹ããããäºç´ããã
確å®ã«å¤§å®¹éã®ãã¼ãã«ãä½ãç´ãããã«ã¯ããã¹ãããäºç´ããç¨ãã¦BigQueryã®è¨ç®è³æºã確ä¿ããå¿ è¦ãããã¾ãã
é常ã®ã¯ã¨ãªå®è¡ã§ã¯äºç´ããªãã¦ããªã³ããã³ãã§è¨ç®è³æºãèªåçã«ç¢ºä¿ããã¦ãã¾ããã大容éã®ãã¼ãã«ã®ä¸æ¸ãã§ã¯ããªãã®è¨ç®è³æºãå©ç¨ãããããå åãã¤å®å®çãªç¢ºä¿ãã§ããªãå ´åã¯ä¸è¨ã®ãããªã¨ã©ã¼ãéä¸ã§çºçãã¦ãã¾ããããç´ãã«ãªãå¯è½æ§ãé«ãã§ãã
Resources exceeded during query execution: Your project or organization exceeded the maximum disk and memory limit available for shuffle operations. Consider provisioning more slots, reducing query concurrency, or using more efficient logic in this job.
ãã®ããä¸è¨ã®ããã¥ã¡ã³ãã«å¾ã£ã¦ã¹ãããäºç´ãå®è¡ãã¾ãããªãã¹ãããäºç´ã®å®¹éã«ã¤ãã¦ã¯ããªãã¬ã¤ã¹å¾ã®ãã¼ãã«å®¹éã«ãããã¾ããããªãã¹ã確å®ã«å®è¡ãã観ç¹ã§ã¯ä¸éã¾ã§äºç´ãããã¨ããå§ããããã¾ãã
ã¹ãããäºç´ã®æä½æ¹æ³
ãªãæéã«ã¤ãã¦ã¯ãä¾ãã°USãªã¼ã¸ã§ã³ã§10,000ã¹ãããã®äºç´ã®å ´åã1æéã«ã¤ã $0.04 à 10000 = $400 å©ç¨æããããã¾ãã
ã¾ãå®è¡ã«ããã£ãæéã«ã¤ãã¦ã§ãããç§ãã¡ã®ããã¸ã§ã¯ãã§å®è¡ããå®ç¸¾ã¨ãã¦ã¯ããªãã¬ã¤ã¹å¾ãã®ãè«çãã¤ãæ°ãã§ãããã
ç´ 7TB ã®å ´å â 9åï¼ã¹ãããäºç´ç¡ãã¦ãå®è¡å¯ï¼
ç´ 150TB ã®å ´å â 4æé
ã§ããã äºåã®æ£ç¢ºãªäºæ¸¬ã¯é£ããã§ããã容éã«ãã£ã¦ã¯ç¸å½ãªæéã¨éé¡ãããããã¨ã«ãªãã¾ãã
æé 3ï¼ã¿ã¤ã ãã©ãã«ã®ä¿ææéã確èªããã
BigQueryã«ã¯ãä¸å®ã®æéã¯å®¹æã«ãã¼ã¿ãå¤æ´åã«å¾©å ãããã¨ãå¯è½ã«ãªãã¨ãããã¿ã¤ã ãã©ãã«æ©è½ãããã¾ãã
ã¿ã¤ã ãã©ãã«ã«ã¤ãã¦ã®è©³ç´°
ããã¯ãã¼ãã«ãä¸æ¸ãããå ´åã§ãã£ã¦ã復å å¯è½ã§ãããããä¸ä¸ã®å¤±ææã«ãå®å¿ã§ãã
ãã ãä¸ã¤åé¡ã«ãªãã®ãã¹ãã¬ã¼ã¸æéã§ãã
ã¿ã¤ã ãã©ãã«æéã«ã¤ãã¦ã¯2ã7æ¥éã®ç¯å²ã§è¨å®ã§ãã¾ãããã¿ã¤ã ãã©ãã«æéä¸ + ãã§ã¤ã«ã»ã¼ãæéä¸(7æ¥é)ã¯å¼ãç¶ãåé¤ããããã¼ã¿ã«å¯¾ãã¦ãä¿åã³ã¹ãããããã¾ãããã¼ãã«ã®ä¸æ¸ããå®è¡ãããã¨ããå¼ãç¶ã9ã14æ¥åã¯æéããããç¶ãããã¨ã«ãªããã¨ã«çæããå¿ è¦ãããã¾ãã
ãã®ãããã³ã¹ãã¨ä¸ä¸ã®éã®ãã¼ã¿å¾©å ã¿ã¤ãã³ã°ãéã¿ã¦æéãè¦ç´ãã¦è¨å®ãããã¨ãæ¨å¥¨ãã¾ãã
ã¾ãå価ããã¼ãã«ãä¸æ¸ãããç´å¾ã§ãããã¨ã«ãã£ã¦ãé·æä¿åãæéã§ã¯ãªããå ¨ã¦ããå²é«ãªãã¢ã¯ãã£ãã¹ãã¬ã¼ã¸ãæéã¨ãã¦ãããã¾ãã
BigQueryã®ã¹ãã¬ã¼ã¸æé詳細
æé 4ï¼CREATE OR REPLACE TABLE ã¯ã¨ãªãå®è¡ããã
ä¾
CREATE OR REPLACE TABLE (ãã¼ãã«å) AS (SELECT * except (åé¤ãããã«ã©ã å) from (ãã¼ãã«å))
â» ã¯ã©ã¹ã¿ãªã³ã°ããã¼ãã£ã·ã§ã³çãå©ç¨ãã¦ããå ´åã¯ããã®åã®è¨å®ãã¯ã¨ãªã«å¿ è¦ã§ãã
æé 5ï¼æé 1ã3ã§è¡ã£ãæä½ãå ã«æ»ãã
ã¹ãããäºç´ã解é¤ãã該å½ãã¼ãã«ã¸ã®ã¬ã³ã¼ãã®æ¿å ¥ãåéãã¾ãã
ã¾ãã¿ã¤ã ãã©ãã«ã®ä¿ææéãå¿ è¦ããã°å ã«æ»ãã¾ãã
ã¾ã¨ã
BigQueryã®ãã¼ãã«ã§ä¸è¦ãªã«ã©ã ãçããå ´åã§ãããã®ããã«ã«ã©ã ãåé¤ãã¦ä¿åã³ã¹ããåæ¸ãããã¨ã¯å¯è½ã§ãã
ããããç¾ç¶ã§ã¯ãã¼ãã«ã®ãªãã¬ã¤ã¹ãå¿ è¦ã«ãªããã¾ããã¼ãã«ãä½ãç´ãããã«æ§ã ãªè¨å®ãä¸æçãªå¯¾å¿ã³ã¹ããããããã¨ã«ãªãã¾ãã
ç¶æ³ãå¤åãã¦ãä¸è¦ã«ãªã£ãç¹å®ã«ã©ã ã®ä¿åã³ã¹ãã§é ãæ©ã¾ãããã¨ãç¡ããããå¯è½ãªç¯å²ã§å ãè¦æ®ãã¦è¨è¨ãããã¨æããã£ããã«ããªãã¾ããã