Live data from Hacker News

Instant database clones with PostgreSQL 18

boringsql.com

81–90 of 168 posts

Re: Instant database clones with PostgreSQL 18

#81

Earlier quoted context omitted.

Agent authorship doesn't imply unreviewed or underspecified code

Vibe coded means precisely that!

Yes but there’s no evidence this is vibe coded or not. You’re cynically claiming it due to agent authorship. As if there is no legitimate use.

> No human expert involved

You don’t know this, you are just hating.

Besides the close review and specification that may be conducted with agents, even if you handwrite / edit code, it will say that it was co-authored by the agent if you have the agent do the commit for you.

Re: Instant database clones with PostgreSQL 18

#82

Earlier quoted context omitted.

I think you need to start with the following statement: > We would like to acknowledge the open source people, who are the traditional custodians of this code. We pay our respects to the stack overflow elders, past, present, and future, who call this place, the code and libraries that $program sits upon, their work. We are proud to continue their tradition of coming together and growing as a community. We thank the s…

> a Brazilian invented the airplane lol, good one!

wasn't it?

last I checked, Wright brothers used a catapult while Santos-Dumont made a plane that took off by itself.

Re: Instant database clones with PostgreSQL 18

#83

As an aside, I just jumped around and read a few articles. This entire blog looks excellent. I’m going to have to spend some time reading it. I didn’t know about Postgres’s range types.

Range types are a godsend when you need to calculate things like overlapping or intersecting time/date ranges.

Can you give a real world example?

Re: Instant database clones with PostgreSQL 18

#84

Earlier quoted context omitted.

Let's say there is an architect and he also owns a construction company. This architect, then designs a building and gets it built from of his employees and contractors. In such cases the person says, I have built this building. People who found companies, say they have built companies. It's commonly accepted in our society. So even if Claude built for it for GP, as long as GP designed it, paid for tools (Claude) to…

I agree that it's ultimately about the product. But here's the problem. Five years ago, when someone on here said, "I wrote this non-trivial software", the implication was that a highly motivated and competent software engineer put a lot of effort into making sure that the project meets a reasonable standard of quality and will probably put some effort into maintaining the project. Today, it does not necessarily impl…

We know. It is not difficult to tell them apart. Good taste is apparent and beauty is universal. The amount of care and attention someone put into a craft is universally appreciated. Also, I am 100% confident this comment was the output of a human process. We can tell. There is something more. It is obvious for those that have a soul.

Re: Instant database clones with PostgreSQL 18

#86

Is anyone aware of something like this for MariaDB? Something we've been trying to solve for a long time is having instant DB resets between acceptance tests (in CI or locally) back to our known fixture state, but right now it takes decently long (like half a second to a couple seconds, I haven't benchmarked it in a while) and that's by far the slowest thing in our tests. I just want fast snapshotted resets/rewinds t…

I was able to accomplish this by doing each test within its own transaction session that gets rolled-back after each test. This way I'm allowed to modify the database to suit my needs for each test, then it gets magically reset back to its known state for the next test. Transaction rollbacks are very quick.

As a consultant, I saw many teams doing that and it works well.

The only detail is that autoincrements (SEQUENCEs for PotgreSQL folks) gets bumped even if the transaction rollsback.

So tables tend to get large ids quickly. But it's just dev database so no problem.

Re: Instant database clones with PostgreSQL 18

#87

Earlier quoted context omitted.

Let's say there is an architect and he also owns a construction company. This architect, then designs a building and gets it built from of his employees and contractors. In such cases the person says, I have built this building. People who found companies, say they have built companies. It's commonly accepted in our society. So even if Claude built for it for GP, as long as GP designed it, paid for tools (Claude) to…

I agree that it's ultimately about the product. But here's the problem. Five years ago, when someone on here said, "I wrote this non-trivial software", the implication was that a highly motivated and competent software engineer put a lot of effort into making sure that the project meets a reasonable standard of quality and will probably put some effort into maintaining the project. Today, it does not necessarily impl…

In general that is all implication and assumption, for any code, especially OSS code.

Re: Instant database clones with PostgreSQL 18

#88
post #75

Earlier quoted context omitted.

I agree that it's ultimately about the product. But here's the problem. Five years ago, when someone on here said, "I wrote this non-trivial software", the implication was that a highly motivated and competent software engineer put a lot of effort into making sure that the project meets a reasonable standard of quality and will probably put some effort into maintaining the project. Today, it does not necessarily impl…

The original person didn't say "I wrote this non-trivial software", they said "I built Velo".

...and pointed us to a repository containing non-trivial software.

Re: Instant database clones with PostgreSQL 18

#89

Earlier quoted context omitted.

But how does the reset happen fast, the problem isn't with preventing permanent writes or w/e, it's with actually resetting for the next test. Also using overlayfs will immediately be slower at runtime than tmpfs which we're already doing.

Yeah unfortunately I think that it's not really possible to hit the speed of a TEMPLATE copy with MariaDB. @EvanElias (maintainer of https://github.com/skeema/skeema about this) was looking into it at one point, might consider reaching out to him — he's the foremost mysql expert that I know.

Thanks for the kind words Peter!

There's actually a potential solution here, but I haven't personally tested it: transportable tablespaces in either MySQL [1] or MariaDB [2].

The basic idea is it allows you to take pre-existing table data files from the filesystem and use them directly for a table's data. So with a bit of custom automation, you could have a setup where you have pre-exported fixture table data files, which you then make a copy of at the filesystem level, and then import as tablespaces before running each test. So a key step is making that fs copy fast, either by having it be in-memory (tmpfs) or by using a copy-on-write filesystem.

If you have a lot of tables then this might not be much faster than the 0.5-2s performance cited above though. iirc there have been some edge cases and bugs relating to the transportable tablespace feature over the years as well, but I'm not really up to speed on the status of that in recent MySQL or MariaDB.

[1] https://dev.mysql.com/doc/refman/8.0/en/innodb-table-import....

[2] https://mariadb.com/docs/server/server-usage/storage-engines...

Re: Instant database clones with PostgreSQL 18

#90

PostgreSQL seems to have become the be-all, end-all SQL database that does everything and does it all well. And it's free! I'm wondering why anyone would want to use anything else at this point (for SQL).

Can’t really run it on iOS. And its WASM story is weak
Post reply on HN