til
til copied to clipboard
You only feel happy when you know what you doing
> Each of these “backend” processes starts out at around 5 MB in size, but may grow to be much larger depending on the data they’re accessing [1](https://brandur.org/postgres-connections#footnote-1). https://brandur.org/postgres-connections >...
https://jmap.io/index.html
[Postgres: Safely renaming a table with no downtime using updatable views](https://brandur.org/fragments/postgres-table-rename)
https://thebuild.com//presentations/xtreme-sfpug-2023-02-08.pdf
In Python, we have `type(variable)` method or `typeof` in Javascript to check the variable type. So I tried to implement a stored procedure. And I want to check the type...
```python3 #!/usr/bin/env python3 from netaddr import * import math def main(): """ Main function """ cidr = "10.0.0.0/8" assigned = [ "10.100.0.0/20", "10.100.128.0/20", "10.100.160.0/20", "10.100.192.0/20", "10.100.208.0/20", "10.100.224.0/20", "10.100.240.0/20", "10.100.32.0/20", "10.100.64.0/20",...
```lua local counter = 0; local cursor = 0; repeat local res, _ = redis.call("SCAN", cursor, "MATCH", "pattern-*", "COUNT", 100); local keys = res[2]; for i = 1, #keys do...
https://shekhargulati.com/2022/07/08/my-notes-on-gitlabs-postgres-schema-design/
``` SELECT relname as "table", pg_size_pretty(pg_relation_size(relid)) AS tb_size, pg_size_pretty(pg_total_relation_size(relid)) As "total_size", pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "idx_size" FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC LIMIT 10; ``` - table – The name...
``` -i : inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x ```