Readit News logoReadit News
leononame commented on What is better: a lookup table or an enum type?   cybertec-postgresql.com/e... · Posted by u/todsacerdoti
unwind · 19 days ago
I don't database, but I like to think I have some kind of intuition for storage space requirements, and this article was very confusing.

Ignoring the indexes and just focusing on the main table sizes reported, we have:

- String ("The frequent repetition of these names inflates the size of the table"): 392 MB

- Enum data type ("Internally, an enum type is stored as four-byte floating point number. So it saves space in the table [...]"): 338 MB

- Lookup table ("Also, since a smallint only occupies two bytes, the person_l table can potentially use less storage space than the other solutions"): 338 MB.

I just can't make sense of the numbers, especially given the authors comments that I've quoted.

Is this some kind of typo/editing fail?

leononame · 19 days ago
I'm also wondering about that. But maybe this could be it?

> Surprisingly, the table is just as big as with the enum type above, even though an enum uses four bytes. The reason is that each table row is aligned at a memory address divisible by eight, so PostgreSQL will add six padding bytes after the smallint. If we had more columns and could arrange them carefully, we could see a difference.

This could be the explanation. If the row is padded to 8, bigint is 8, then smallint or enum also use 8. The entries in the string table will be 8 or 16 due to the string length. So one row in person_e and person_l is 16, one row in person_s could be about 20 on average, that is a bit closer to the reality than my intuition, although the storage savings are still less than what I would have expected.

edit:

I did also try out the test and dropped the primary key on the table to compare only enum and string size:

  SELECT PG_SIZE_PRETTY(PG_RELATION_SIZE('person_e')), PG_SIZE_PRETTY(PG_RELATION_SIZE('person_s'))

  277 MB,330 MB
Does not look like an amazing saving either.

leononame commented on A new experimental Go API for JSON   go.dev/blog/jsonv2-exp... · Posted by u/darccio
int_19h · 3 months ago
It is different from nil, but then again a nil map in Go behaves like an empty map when reading from it. If you consider serialization to be "reading", therefore, it makes sense to interpret it accordingly.
leononame · 3 months ago
That is not true, though. Reading from a nil map panics, and reading from an empty map does not.
leononame commented on Croatia just revised its digital nomad visa to last up to 3 years   cnbc.com/2025/08/15/croat... · Posted by u/toomuchtodo
littlecranky67 · 4 months ago
I understand you perfectly clear, but to me you are spreading socialist ideas. If prices are high for a given scarce resource, it is because of high demand. Now you want to basically cut off demand (less foreigners, DNs) for prices to go down. But you do need the high price signal in order to create an incentive to create more of that resources.

In the case of the EU (I'm a german EU citizen living in another EU state) we are all equal in terms of freedom of movement. There are no "locals" that have for some reasons more rights to any resources than anyone else. Giving "locals" preferential rights is completely unfair, as this would be excercising some kind of birth right.

I myself getting priced out of vintage german sportscars myself, could we please cut the rights for non-germans to buy up those cars so I can afford one again? You can see how ridicioulous that would sound.

leononame · 4 months ago
I think there's multiple things coming together. I'm in no way arguing to forbid immigration, I'm just pointing out that I don't think Digital Nomads are a net positive and that there are real economic consequences beyond "they spend money so it's good".

I also specifically said I don't have a problem with anyone coming. You're welcome. I expect people that come to to a country to pay income tax there (as is usually required by law), but I'm in no way arguing to "cut off demand".

Arguing that someone who would want to close borders and stop immigration (both of which policies I don't support at all, btw) is socialist is a bit far fetched. As I said, I welcome immigrants. Immigration brings with it a whole class of problems that need be addressed, but that doesn't mean it should be forbidden.

And lastly, there's also a big difference between housing a vintage cars. One is an essential need, the other is not. You getting priced out of vintage cars, a luxury item, is not nearly as bad as you getting priced out of housing. That is a real problem that is actually happening in a lot of places, not some weird fantasy.

leononame commented on Croatia just revised its digital nomad visa to last up to 3 years   cnbc.com/2025/08/15/croat... · Posted by u/toomuchtodo
littlecranky67 · 4 months ago
> Take a place like Barcelona, a famous example for people not being able to live there anymore due to high prices.

I always hear this bullshit "People can't afford to live there anymore". That is complete nonsense, because unless there are deserted buildings and empty apartments, people DO live there and people CAN afford it. Just not you.

leononame · 4 months ago
I feel like either you're really dense or you're misunderstanding me on purpose.

It's exactly my point that mist people can't afford to live their because they're being priced out by foreigners. Most people native to such an area see that as a net negative, regardless of how much you want to dress it up as people coming and spending their money.

leononame commented on Croatia just revised its digital nomad visa to last up to 3 years   cnbc.com/2025/08/15/croat... · Posted by u/toomuchtodo
littlecranky67 · 4 months ago
> When people only pay taxes indirectly, they are tourists. Digital nomads pay _much_ less tax overall than other people, because people who pay income tax pay indirect taxes as well

Bad argument, as the alternative is the DN (just as the tourist) simply not coming to the island. If a DN spends 2000€ a month, that is 2000€ taxable income for someone else. If the DN doesn't come someone else makes 2000€ less of income. This does not compare to people living in the place, as they are there no matter what. Every cent of foreign money flowing into your economy ON TOP is a bonus. It is only bad if it removes someone else who would spend that money, but that is not the case.

And if you would argue that the economy does not need more foreign money and you do not want productivity and wealth increase and have stay things as they are, you are advocating socalism - look at cuba, venezuela or argentina how that worked out.

leononame · 4 months ago
Well, that only counts if you see the DN as a net positive. Similar to tourists, a lot of people see DN as a net negative because they spend some money, sure, but they also raise rent and hospitality prices. This can harm local communities and economies because it may benefit few people over many or change where people have to go live.

Places relying on tourism as economic activity are very susceptible to economic crisis and it can even go as far as suppressing generation of jobs in other sectors and people leaving because you only find jobs in tourism or you can't afford to live in the city because Digital Nomads live there already. This is obviously exaggerated to make a point, but I think the point still stands in smaller scale.

Foreign money flowing in does not need to be a bonus. DN have the potential to change the microeconomy and in ways that affect your macroeconomy much more than just money flowing in.

Take a place like Barcelona, a famous example for people not being able to live there anymore due to high prices. On top of that, a lot of digital nomads don't interact much with local culture. When people start leaving, is the influx of DN money really still a net positive? Especially considering some of them don't even pay income tax?

I don't want to demonize immigration, but people moving somewhere and treating it like a cheaper version of their hometown is not a positive in any way, culturally or economically.

I am not arguing for socialism by saying that people coming and spending some money (not even that much) is not a sustainable way to do economy. I've got no problem with foreign investors building things that are actually valuable to the economy by building up industry, creating jobs or whatever. Cuba, Venezuela and Argentina have a whole lot of different problems and the reasons they are in the positions they are are much more nuanced than "socialism bad".

leononame commented on Croatia just revised its digital nomad visa to last up to 3 years   cnbc.com/2025/08/15/croat... · Posted by u/toomuchtodo
littlecranky67 · 4 months ago
I am living in a Digital Nomad hotspot, and you are painting a dystopian picture that is not reality. Most DNs I know work either from Home or Coworking Spaces, which have sprawled up everywhere. You pay around 150-250€/month for your own desk. There are also now "coworking cafés", that usually target DNs and Coworkers by charging a flat fee (i.e. 5€ a day) a give either a free coffee included, or 10%-20% rebate on drinks/food. These cafés are specifically setup for Laptops (i.e. single table layouts). Other cafés that had those "nursing people" simply put up signs disallowing laptops - which is at every café owners discretion to do so.

In my experience, the local starbucks is crowded with tourists and their laptops (or tablets with keyboards), but these folks are not DNs, they are just waiting for their plane or airbnb to get ready.

Regarding property price and high rent, this discussion is pretty stupid. Every country wants richer-than-average people to come and pay taxes and/or spend their money. I often hear the bogus argument that DNs don't pay taxes which is bullshit, because even DNs pay taxes indirectly, as every amout they spend is someone elses taxable income (this includes rent). If they don't come, those incomes won't exist and no taxes be paid.

Most places in Europe bring in millions of poor immigrants, while some countries (most prominently spain) the people complain about rich immigrants...

leononame · 4 months ago
I live in what's not exactly a digital nomad hotspot, but they do come. You pay 150€/month for a coworking space in a city where some people pay 300-400€/month rent. These digital nomads come here, pay absurd amounts of rent without blinking an eye.

And the tax thing is not a bogus argument. When people only pay taxes indirectly, they are tourists. Digital nomads pay _much_ less tax overall than other people, because people who pay income tax pay indirect taxes as well. If the digital nomads don't come, they also wouldn't raise rent and café prices for everyone around them. You come here, register yourself as a freelancer and pay income tax? You're very welcome in my book. But if you come to the country to leech off its cheap prices but don't pay income tax, you can go back where you came from.

We bring in millions of poor immigrants for various reasons: It's the human thing to do, these immigrants do cheap and hard labor that a lot of natives won't do (think construction, food delivery, etc.) and as such even provide benefits to us.

Digital Nomads mostly aren't immigrants. They come for a limited time, don't provide much to the local economy outside spending some money (and even then it's not that much because a lot of them come to cheap countries to live for cheap and save money) and then leave again. It's not really comparable.

leononame commented on Good Writing   paulgraham.com/goodwritin... · Posted by u/oli5679
antirez · 7 months ago
I believe that it is not that style helps the content to be more right, not in the way PG believes (like in the example about writing shorter sentences), it is that a richer style (so, not shorter, but neither baroque: a style with more possibilities) can reflect a less obvious way of thinking, that carries more signal.

I'll make an example that makes this concept crystal crisp, and that you will likely remember for the rest of your life (no kidding). In Italy there was a great writer called Giuseppe Pontiggia. He had to write an article for one of the main newspapers in Italy about the Nobel Prize in Literature, that with the surprise of many, was never assigned, year after year, to Borges. He wrote (sorry, translating from memory, I'm not an English speaker and I'm not going to use an LLM for this comment):

"Two are the prizes that each year the Swedish academy assigns: one is assigned to the winner of the prize, the other is not assigned to Borges".

This uncovers much more than just: even this year the prize was not assigned to Borges. And, honestly, I never saw this kind of style heights in PG writings (I appreciate the content most of the times, but having translated a few of his writings in Italian, I find the style of PG fragile: brings the point at home but never escapes simple constructs). You don't reach that kind of Pontiggia style with the process in the article here, but via a very different process that only the best writers are able to perform and access.

leononame · 7 months ago
The quote reminds me of Tucholsky, a German journalist known for this style. An example that comes to mind was his review of James Joyce's Ulysses: "It's like meat extract: you can't eat it, but many soups will be made with it".

I think putting a bit of fun writing into reports of everyday events or reviews can go a long way. Tucholsky again, I'm paraphrasing and translating from memory where he wrote a trial against dada artist Grosz who depicted army officials as grotesque and ugly: "To demonstrate that there are no faces like this in the Reichswehr (the army), they brought in lieutenant so-and-so. They shouldn't have done that."

Good writing goes a long way

leononame commented on Show HN: Outerbase Studio – Open-Source Database GUI   github.com/outerbase/stud... · Posted by u/burcs
wiseowise · a year ago
> Browser based
leononame · a year ago
Still a valid counterargument. A good browser based DB GUI might just not exist because the existing desktop ones are so good already.

I personally also vouch for DataGrip, a fantastic tool. No browser based tool is going to come close to the experience of an actual desktop app imo

leononame commented on Can humans say the largest prime number before we find the next one?   saytheprime.com/... · Posted by u/robinhouston
Xcelerate · a year ago
Ooh, let’s do this with the Busy Beaver function too. BB(5) is only 12,289 binary digits to say out loud. BB(6) and BB(7) can’t possibly take that much longer to say.
leononame · a year ago
For context, because I had to look it up: For BB(6), Σ(6) is known to be least 10 ↑↑ 15 for in Knuth's up-arrow notation. You can read this as 10^(10 ↑↑ 14) = 10^(10^(10 ↑↑ 13)) and so on. It's much more than just a lot.

Anyone know how many digits this is?

leononame commented on Ask HN: Life-changing purchases since 2020? (Under $100 and under $1000)    · Posted by u/systemkwiat
keiferski · a year ago
Dentists pretty much universally recommend electronic toothbrushes, in my experience.
leononame · a year ago
Interesting, the dentists I have asked (4) all said it doesn't matter (Spain and Germany, maybe it's relevant) at all and it's up to personal preference.

u/leononame

KarmaCake day805April 25, 2022
About
My name is Leo.

Contact me at

hn [at] lho [dot] io

meet.hn/city/es-A Coruña

View Original