![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
第7回 PostgreSQLアンカンファレンス@東京
-
nuko_yokohama
- 1454
- 0
- 0
- 0
![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
boto3ってまだpreviewなの? boto(無印)は使えない機能でてきてるから、縛りがなければ3使う方がいいんじゃないかと思うけど… #pgunconf
2016-05-28 16:50:59![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
aws_fdwでinsert into aws.ec2 values(‘r3.xlarge’, …);でインスタンス起動される、みたいな夢を見た。 #pgunconf
2016-05-28 16:51:34![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf 現状は並列度はテーブルサイズに依存している。ユーザがコントロールすることが難しい。max_parallel_degreeは上限設定でしかない。なので、パッチをかけて、動的に変更させている。
2016-05-28 16:52:01![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf force_parallel_mode=offなのにworker processが64になっているのは何故?問題が。 ライブの醍醐味であるw
2016-05-28 16:55:13![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf 改善が見込めそうなら、parallel_forceがoffでも改善プランにしちゃう。(花田さん)
2016-05-28 16:56:15![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf ordersに対して検索が300msかかった。64プロセスで一気に転送。 (メモリに乗っていれば)
2016-05-28 16:57:44![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
EC2はboto3の resource() 側のAPIがそこそこ充実しているので、基本的にはこっちから試す方がおすすめだと思う(この話の本筋ではないけど) #pgunconf
2016-05-28 16:57:44![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf count(*)のordersから64並列で動かした例。これもメモリに乗っていれば超速い。
2016-05-28 17:02:27![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
そりゃあそうか AWS RDS - PostreSQL plpython support forums.aws.amazon.com/thread.jspa?th… #pgunconf
2016-05-28 17:03:06![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf 現状のJSON関数だとjson_eachでトップレベルのキー/値の組は返せるが、2レベル以降が処理できない。なのでWITH句で書いてみよう。
2016-05-28 17:06:28![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf JSONの場合には、3パターン(オブジェクト、配列、スカラ)あるので、ちょい面倒。jsonb_typeofとCASEを組み合わせる。
2016-05-28 17:10:08![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf 再帰クエリは、以前、住所を階層的に結合させるみたいな処理で使ったなー。なお、そのときは町田市を東京都と神奈川県の両方に属させた。 #町田は神奈川
2016-05-28 17:13:41![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#pgunconf 2つのサイコロを振って対戦するという再帰クエリで表現するという、誰得なクエリ。いいぞ、もっとやれ。
2016-05-28 17:14:52