Better HN
topnewbestaskshowjobs
Log inSign up

mkleczek

283 karma · joined Jun 30, 2017 (9y ago) · 211 submissions

Submissions

1.

Show HN: Pseudogress – high performance PostgreSQL mock for testing(github.com ↗)

1 points · by mkleczek · 1mo ago · discuss

comment 1mo ago · link · parent

There is no AI in the world that can replace live AC/DC performance.

comment 1mo ago · link · parent

That's my recent experience as well. You have to know the domain and have technical knowledge so that you understand (not in every detail) what AI is actually doing and why. You also have to understand what you want and why you want it.

But once you do, working with AI is like having a very capable team of programmers knowing all programming languages you might need and understanding your goals.

comment 2mo ago · link · parent

Because it is not capable of ordered index scan that handles both filtering (by multiple conditions) and "order by" - text search returns potentially a very large set of results that must be sorted and then truncated (to satisfy limit).

EDIT: or I misunderstood the question. GIST+trgm works but its search capabilities are limited, it does not handle "order by column" so requires weird workarounds, and it is not very efficient.

comment 2mo ago · link · parent

I am still looking for a good solution to the following use case:

create table entry (id, user, entry_date, entry_text);

select * from entry where user = ? and entry_date <= ? and entry_text matches ? order by entry_date desc limit ?;

(eg. page through the list of financial transactions with description matching some criteria, latest first)

So far only GIST with pg_trgm handles that without the need to sort large result sets.

comment 3mo ago · link · parent

The issue is that incremental computation is a non-trivial problem that cannot be solved on a language design level.

There are some new interesting players in the field though, eg. https://github.com/feldera/feldera

comment 10mo ago · link · parent

Much more principled (and hence less of a foot-gun) way of handling conflicts is making them first class objects in the repository, like https://pijul.org does.

comment 10mo ago · link · parent

Shameless plug: https://github.com/mkleczek/pgwrh automates it quite a bit.

comment 10mo ago · link · parent

From my experience the issue really is, unfortunately, that it is impossible to tell if a particular detail is irrelevant until after you have analyzed and answered all of them.

In other words, it all looks easy in hindsight only.

comment 10mo ago · link · parent

At least in case of the kitchen contractor, you can trust all the electrical equipment, plumbing etc. is going to be connected in such a way that disasters won't happen. And if it is not, at least you can sue the contractor.

The problem with LLMs is that it is not only the "irrelevant details" that are hallucinated. It is also "very relevant details" which either make the whole system inconsistent or full of security vulnerabilities.

comment 10mo ago · link · parent

I am Polish and I was 15 in 1990 when the Berlin Wall fell.

Lately I was thinking if it was only me or my fellow Poles remembering 90s as times of freedom and hope.

Thanks for confirming it is much wider experience and memory.

comment 10mo ago · link · parent

Indeed. The organization changed in the passing years.

My worry is that there is more will to just dissolve it instead of working on improving it.

comment 10mo ago · link · parent

This.

It looks like it goes in cycles: after major catastrophic event subsequent generations that don't remember the catastrophe are willing to engage in another one (I think of WWI and WWII as one event). If the memory was stronger there would be more pressure to find other means of resolving issues.

Eg. as a "half boomer" European I remember well why EU was created. It looks like the reasons have been largely forgotten now.

comment 10mo ago · link · parent

> The economic interest is the US ability to as rapidly as possible convert those shipyards to military shipyards during a large scale prolonged war.

Nah, that doesn't add up. US needs _ships_ and SOTA military equipment to make sure that any military conflict is as short as possible (ie. US wins). Losing money on unused production capability does not make sense because in case of prolonged conflict there is time to build the capability (as it happened during WWII).

In reality, what you call "prolonged military conflict", is nothing more than normal international competition. One could even argue US is in prolonged military conflict since WWII. In which case making rational decisions based on hard economic criteria (ie. not losing money) is the key to success.

comment 10mo ago · link · parent

> Insofar as the country being conquered and Americans being slaughtered wholesale would be against our economic interests lol > There are clear national security reasons for the government to prop up shipbuilding and semiconductors.

Are you saying countries without shipbuilding facilities or not producing semicondutors are being conquered and their citizens being slaughtered?

I'd say that is fear mongering done by the people doing business on "national security".

comment 10mo ago · link · parent

The question is: how do you define "national security" and "other strategic value"? At the end of the day both really mean economic interest. Especially in case of US.

So if someone says "national security" is above economic interest of US, I would say these people mean _their_ economic interest is above economic interest of US and use both terms as a cover.

comment 10mo ago · link · parent

With current military technology it is not really possible, is it? https://www.youtube.com/watch?v=NdppYYfQJgg describes it really well.

So the question is more about what part of means of defense you outsource. And what parts of means of defense are outsourced by your enemies.

You don't want to base your defense on inferior shipbuilding capabilities, do you?

comment 10mo ago · link · parent

The theory is that in both cases (ie. with and without tariffs) shipyards are going to die sooner or later. It is better for the society to let them die as soon as possible and direct efforts to things we are better at while taking advantage of cheaper ships produced elsewhere.

comment 10mo ago · link · parent

This.

In-RDBMS computation specified in declarative language with generic, protocol/technology specific adapters handling communication with external systems.

Treating RDBMS as a computing platform (and not merely as dumb data storage) makes systems simple and robust. Model your input as base relations (normalized to 5NF) and output as views.

Incremental computing engines such as https://github.com/feldera/feldera go even further with base relations not being persistent/stored.

comment 11mo ago · link · parent

https://news.ycombinator.com/item?id=46432107

I wonder if (when?) elites are going to use and support Bitcoin. Oppressive governments will force citizens - even such powerful as judges - to search for escapes.

comment 11mo ago · link · parent

Here on HN I will be downvoted to oblivion but well... let's be it:

There is no other way for us mortals than to go back to cash... Or start using Bitcoin. Be your own bank. Vote with your money.

comment 11mo ago · link · parent

> I don’t see how this is true.

There is a Bitcoin seller B, a thieve T and a victim V.

T proposes to buy Bitcoin from B. T offers a new iPhone for a very low price to unsuspecting V. V agrees to buy it. B gives T account details and transaction reference so that T can transfer money to B's account. T gives these details to V. V transfers the money. B transfers Bitcoin to T. T disappears.

If only transaction reference contained information that the transfer is about buying Bitcoin, V would have never paid the money.

The scheme was quite common in UK because banks did not like Bitcoin so Bitcoin sellers and buyers avoided referencing it in bank transfers.

comment 11mo ago · link · parent

> * Based on the data they identify

> * easy to remember

(which means human readable and related to the actual information which makes them easier to remember)

These actually are the most important features.

Example: transaction references not related to the actual subject of the transaction (ie. what is being paid for) is enabler for MITM scam schemes.

> Short is convenient

Nah. Short is crucial for identifiers to be effective for computers to handle (memory and CPU efficiency). Otherwise we wouldn't need any identifiers and would just pass raw data around.

> * versioned - Versioning is only interesting because you’re trying to derive from real data.

Nah. Even UUID formats contain version information.

> * easy to index - Sure.

> * sortable - Nice to have at best.

These are directly related (and in the context of UUIDv4 vs UUIDv7 discussion sortable is not enough - we also want them to be "close" to each other when generating so that they can be indexed efficiently)

comment 11mo ago · link · parent

> This hacker news article was given a surrogate key, 46272487. From that, you can determine what it links to, the name/date/author of the submission, comments, etc.

> Do not encode identifying information in unique identifiers! The entire world of software is built on surrogate keys and they work wonderfully.

The amount of manual work required to manage duplicates is in no small part the result of not thinking enough about the identifiers and simply slapping surrogate keys on the data.

comment 11mo ago · link · parent

> Your notion that you can avoid sharing internal ids is technically true, but that didn’t mean it’s a good idea. You’re trying force a philosophical viewpoint and disregarding practical concerns, many of which people have already pointed out.

What some call "philosophical viewpoint" I call "essential complexity" :)

> But to answer your question, yes, your customer will probably have some notion of a transaction id. This is why everyone gives you invoice numbers or order numbers.

We are in agreement here: externally visible identifiers are needed for many reasons (mostly technical). The discussion is not about that though but about what information should be included in these identifiers.

> This is why everyone gives you invoice numbers or order numbers.

And there are good reasons why invoice or order numbers are not randomly generated strings but contain information about the invoices and orders they identify.

My claim is that externally visible identifiers should possess a few characteristics:

* should be based on the data they identify (not detached from it)

* should be easy to remember (and that means they should be as short as possible, they should be easy to construct by a human from the data itself - so they cannot be hashes of data)

* should be versioned (ie. they should contain information somehow identifying the actual algorithm used to construct them)

* should be easy to index by database engines (that is highly db implementation dependent unfortunately)

* can be meaningfully sortable (that is not strictly a requirement but nice to have)

Coming up with an identifier having these characteristics is not trivial but is going to pay off in the long run (ie. is essential complexity).

comment 11mo ago · link · parent

I am not sure you are arguing against my claims or not :)

I am not arguing against surrogate keys in general. They are obviously very useful _internally_ to introduce a level of indirection. But if they are used _internally_ then it doesn't really matter if they are UUIDs or sequence numbers or whatever - it is just an implementation detail.

What I claim is that surrogate keys are problematic as _externally visible_ identifiers.

> Okay, then lets do an exercise here. A user gives you a transaction ID, and you have to tell them the date they signed up and the date you first billed them. I think yours is going to be way more complicated.

> Mine is just something like:

> SELECT user_id FROM transactions WHERE transaction_id=X; SELECT transaction_date FROM transactions WHERE user_id=Y ORDER BY transaction_date ASC LIMIT 1; SELECT signup_date FROM users WHERE user_id=Y;

I think you are missing the actual problem I am talking about: where does the user take the transaction ID from? Do you expect the users to remember all transaction IDs your system ever generated for them? How would they know which transaction ID to ask about? Are they expected to keep some metadata that would allow them to identify transaction IDs? But if there is metadata that enables identification of transaction IDs then why not use it instead of transaction ID in the first place?

comment 11mo ago · link · parent

The article only discusses reasons why formal verification is needed. It does not provide any information on how would AI solve the fundamental issues making it difficult: https://pron.github.io/posts/correctness-and-complexity

comment 11mo ago · link · parent

Any piece of information that can be used to retrieve something using this index has to be available "outside" your database - ie. to issue a query "give me piece of information identified by X" you have to know X first. If X is only available in your index then you must have another index to retrieve X based on some externally available piece of information Y. And then X becomes useless as an identifier - it just adds a level of indirection that does not solve any information retrieval problem.

That's my whole point: either X becomes a "real world artifact" or it is useless as identifier.

12345
8