HN user

jhas78asd

16 karma
Posts4
Comments19
View on HN

If you’re talking about the command line client that’s built in, it’s psql. If you can’t remember the command name to launch it or regularly type those other commands when you meant to type psql, you could add aliases to your shell that point to psql. :)

Learning any new CLI client is a bit daunting at first. With repetition and intention, I think the commands become very memorable. Eg “describe table” is “dt”.

Each of the bullets you listed have very straightforward and memorable meta commands that I use on a regular basis with psql. It may be worth learning them just for when you use Postgres. There is also a built in help. These can also be saved into your dot files so you don’t need to memorize them. Happy to show you if you’re interested!

What’s the reason though for Vitess? Postgres supports tables up to 32TB but hopefully you’re splitting them up using declarative partitioning in one or more ways before that. If you have tables that are smaller than a TB and a large memory DB (>1 TB RAM) Postgres should run ok right? I’d also imagine you’re splitting up your database into multiple databases and multiple instances (the writers) well before that as well right?

Thanks for calling out table partitioning. Besides implementing it at one level, multiple levels can be used simultaneously (eg list and range). Tables can be grouped and split out to their own database (aka functional sharding/vertical sharding) and again partitioned. This all takes more effort and investment but keeps you on PostgreSQL. As you said fillfactor can be tuned, more HOT updates. Even analyzing whether the Updates could be turned into inserts that are written at a high rate, not incurring bloat, and then fewer updates are made at a rate that does not outrun Vacuum.

We didn't write up our rollback plan, but here was the gist. Since we first had to remove the primary key from all children in order to add the conflicting composite primary key to the parent (that propagated to children), if we aborted the whole process, we'd then need to restore the single column PK on children again by creating the PKs we'd just removed.

In both cases, success or failure, before swapping a second time we needed to copy forward all the rows being inserted into the placeholder table.

Other disaster mitigations are capturing a dump of rows for the relevant partitions being modified with pg_dump. And having physical database backups with snapshots enabled and available if things really go wrong.

In Part 2 of this 2 part PostgreSQL Table Partitioning series, we'll focus on how we modified the Primary Key online for a large partitioned table. This is a disruptive operation, so we had to use some tricks to pull this off.

Recently we faced a challenge working with a large table where query performance had worsened. This is a high growth database table that tracks applicants as they move through their hiring process. Find out how we used PostgreSQL table partitioning to help solve this.

This talk covers 5 challenging areas when scaling Rails applications on PostgreSQL databases. Slides and a video recording of the presentation are available, as well as a supplemental content page with examples. Feedback is appreciated.

The article failed to mention the high cost of medical school, high interest rates for loans, and being phased out of interest deductions from earnings (which are capped quite low IMO to being with). My wife attended a Big 10 university medical school, costing around 50K/year, graduating with around 200K of debt, added to her 50K of undergrad debt, deferred through most of training, making 50-60K as a resident and fellow, looking at a 2000+/month expense for P&I on those loans. We've re-financed it, but the rates are still quite high relative to car loans, home mortgage etc., so of course this reality of essentially carrying a second mortgage of debt, was a factor in her choosing to go into a specialty, with additional training (fellowship), and moving to a lower cost, higher demand (higher wage) area. We pay 15K+ INTEREST annually on those loans and we are phased out from deducting any of that. If undergrad was less expensive, or free as it is in other countries, if med school was less expensive, doctors could enjoy the same quality of life with less salary.