283 karma · joined Jun 30, 2017 (9y ago) · 211 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
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
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
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
There are some new interesting players in the field though, eg. https://github.com/feldera/feldera
comment 10mo ago · link · parent
comment 10mo ago · link · parent
comment 10mo ago · link · parent
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
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
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
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
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
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
comment 10mo ago · link · parent
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
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
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
> * 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
> 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
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 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
comment 11mo ago · link · parent
That's my whole point: either X becomes a "real world artifact" or it is useless as identifier.