ablog

不器用で落着きのない技術者のメモ

2023-01-01から1年間の記事一覧

Amazon Redshift のソートキー指定による IO量の削減

AWS

計測 分散キー・ソートキーなし # set search_path to ssbgz_no_sortkey; # show search_path; # set enable_result_cache_for_session=off; -- 分散キー・ソートキーは設定されていない # select * from pg_table_def where (distkey = true or sortkey <> …

複数のSQLが記述されたテキストファイルを1SQL=1ファイルに分割する bash スクリプト

以下のような1ファイルにファイル名とSQLテキストがまとめて書かれているファイルを filename1.sql、filename2.sql、filename3.sql のように別々のファイルに分割して、ファイルの中身に "select * from t1;" のような SQL テキストになるようにする bash ス…

Amazon Redshift でソートキーによる IO 削減ができているかどうかを確認する

AWS

svl_query_summary.is_rrscan では判断できない。rows_pre_filter - rows で判断する。 ソートキーがないとき テーブルを作成する CREATE TABLE lineorder ( lo_orderkey integer not null, lo_linenumber integer not null, lo_custkey integer not null, l…

テレカン三種の神器アプリ for macOS

DemoPro 設定 参考 マウスポインターを目立たせるアプリ「screen pointer」の使い方【Mac】 | nemuu.net ScreenPointer ProEdition 購入(¥480) 設定 参考 Macで画面上に図形やフリーハンドで注釈が書ける「DemoPro」 – Webrandum ポインタの種類: https://…

IT技術系でわかりやすいスライドを書く人たち

Brendan Gregg https://www.slideshare.net/brendangregg/presentations Tanel Poder https://www.slideshare.net/tanelp E.Nakai https://www.slideshare.net/enakai Yuto Hayamizu https://www.slideshare.net/hayamiz Kuniyuki Iwashima https://lpc.even…

Amazon Redshift の AUTO COPY を試す

AWS

手順 prefix を作成する aws s3api put-object --bucket awssampledb --key "auto-copy-lineorder/" テーブルを作成する CREATE TABLE public.lineorder ( lo_orderkey INTEGER NOT NULL, lo_linenumber INTEGER NOT NULL, lo_custkey INTEGER NOT NULL, lo_…

Amazon Redshift で Commit/Rollback せずにセッションを閉じた場合の動作

AWS

Amazon Redshift で Commit/Rollback せずにセッションを閉じた場合に commit されているか rollback されているか。psql などの SQL クライアントで autocommit が有効な場合は DML を発行すると自動的に commit を発行するので、commit が発行する前に閉じ…