Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2020-05-01 to 1 month

Read from .xlsx in PowerShell (x64) without using Excel

This article shows how to read .xlsx in PowerShell without Excel. In Windows 10 (x64), you will have to do additional work. You have to install Microsoft Access Database Engine 2010 Redistributable (AccessDatabaseEngine_X64.exe) when you u…

Launch PowerShell process in non-default culture (locale)

In PowerShell on Windows 10, you cannot change the current culture (locale) with chcp command. If you want to launch a new PowerShell process in another culture, once run cmd.exe from PowerShell, execute chcp, and launch powershell.exe fro…

pgbenchでINSERT中心のトランザクションのTPSをできるだけ高くする

動機 DBのチューニング方法なんかの書籍を見てみても、性能向上方法として語られているのはSELECTのチューニングが主で、INSERTに関する記載はあまり見当たりませんでした。ですが、大量のデバイスから飛んできたデータをMQTTやらHTTPやらで受けて、それを生…

常用漢字表を新旧漢字変換の根拠資料に使う場合の制約

文化庁の出している常用漢字表 *1 には康煕字典体と常用漢字の対応が記載されている。ただ詳しく調べてみたら、対応の記載自体に以下のようなコーナーケースがあるみたい。 「著しい差異のないものは省」かれているので「頬⇄頰」のような対応は記載がない。 …

You cannot set CPU affinity of PostgreSQL instance started through pg_ctl with Start-Process and Process.ProcessorAffinity

Background: In Windows, you can set the CPU affinity of an user process with Start-Process PowerShell cmdlet and System.Diagnostics.Process.ProcessorAffinity property like this: $app = Start-Process -FilePath C:\Windows\System32\mspaint.ex…

An error in pgbench: invalid command in command "setrandom"

Background: I tried to run the following transaction script on pgbench contained in PostgreSQL 12: \set nbranches 1 * :scale \set ntellers 10 * :scale \set naccounts 100000 * :scale \setrandom aid 1 :naccounts \setrandom bid 1 :nbranches \…