This example demonstrated to me that Apple is a religion, after many other examples. Try reading Apple's blogs, it's crazy.
I recommend not trying to talk to extremists in any area. Your life will be much better.
755 karma · joined August 1, 2018
This example demonstrated to me that Apple is a religion, after many other examples. Try reading Apple's blogs, it's crazy.
I recommend not trying to talk to extremists in any area. Your life will be much better.
Of course, there are many people in the Rust community who are not religious and try to improve the language, but my general feeling after reading a lot about Rust is to stay very far from the church of Rust.
The best response to this type of community is humor, like this video about a Rust Senior developer https://www.youtube.com/watch?v=TGfQu0bQTKc
Aedes aegypti is an urban mosquito. Degue is an urban disease. The big difference between Brazil and Singapore is sanitation: https://en.wikipedia.org/wiki/Water_supply_and_sanitation_in...
Singapore had 8k cases in 2022. Brazil has 3 million cases of dengue in 2024. Is not the same thing.
In Brazil, the majority of the population does not have sewage. Tap water is not potable and is not distributed every day, in some areas twice a week, in some areas less than that. This creates the need for everyone to have a water tank at home, creating the possibility of a large number of mosquito breeding sites. And the Moskito Aedes aegypti is a terrible vector of 52 diseases [0], among which it transmits a sarcoma (!!!) among hamsters.
The current government tried not to buy vaccines[1], trying to wait for the Butantan vaccine.
The current Brazilian government is the same or worse (!) than the previous one, more censorship, more dead Indians[2], more fires in the Amazon rainforest[3], and one thing is really worse: all the press covers up the mistakes of the current government .
And...politicians are crazy, intelligent, incredible psychopaths. In the last two weeks the discussion has been about freedom of expression, about Elon Musk and so on. Economy, education, security and health are never priorities. It's clear that the government is trying to pass a law to regulate social media (and using Musk and Twitter as an example to do so), and the mainstream press is very eager to do so, because the law has a part that states that social media will pay for links to news sites. It is not a problem for a country that needs sewage.
They are incredibly good at doing nothing. Some things in Brazil have been discussed for over 100 years, an example is a tunnel in the city of Santos[5].
The next government will also be bad, the population will fight over policies and nothing will change. I will never understand why people fight for these psychopaths. "My psychopath is better than yours."
Please, I will not discuss “fascists” or “communists”, left or right, “everything is politics”, “but billionaires are bad”, etc. These are first-world problems. It is irrelevant for a country that needs sewage. Of course this can be discussed, but not in the current proportion. Sewers are much more important than that.
[0] https://en.wikipedia.org/wiki/Aedes_aegypti#Vector_of_diseas... [1] https://saude-ig-com-br.translate.goog/2023-07-03/dengue-min... .html?_x_tr_sl=pt&_x_tr_tl=en&_x_tr_hl=pt-BR&_x_tr_pto=wapp [2] https://g1-globo-com.translate.goog/jornal-nacional/noticia/... -2022-showm-dados-do-ministerio-da-saude.ghtml?_x_tr_sl=pt&_x_tr_tl=en&_x_tr_hl=pt-BR&_x_tr_pto=wapp [3] https://umsoplaneta-globo-com.translate.goog/biodiversidade/... -aponta-estudo.ghtml?_x_tr_sl=pt&_x_tr_tl=en&_x_tr_hl=pt-BR&_x_tr_pto=wapp [4] https://g1-globo-com.translate.goog/sp/santos-regiao/noticia... -no-novo-pac.ghtml?_x_tr_sl=pt&_x_tr_tl=en&_x_tr_hl=pt-BR&_x_tr_pto=wapp [5] https://g1-globo-com.translate.goog/sp/santos-regiao/noticia... -no-novo-pac.ghtml?_x_tr_sl=pt&_x_tr_tl=en&_x_tr_hl=pt-BR&_x_tr_pto=wapp
Rule of thumb: use the highest level of abstraction for your case.
Of course, the Async implementation can be atrocious or in conflict with something already used by your code, forcing you to use a lower level of abstraction.
[1]https://blog.codinghorror.com/the-wrong-level-of-abstraction...
I will never forget the story[1] of a Microsoft developer rewriting a piece of IBM code that had 33 thousand characters, after rewrite ... 220. This generated a war because MS's work was... negative.
[1] https://archive.org/details/bigbluesunmaking00carr/page/4/mo... page 101
The default value of the column:
organization_id int default floor(random()*10)
> Also, if each page contains data from all organizations then sounds very much like it's not clustered by organization_idThe sample data is clustered by foo_created_at_idx, I changed it to be clustered by foo_organization_id_idx
> is not to be so certain that there is "a correct query plan"
Yes, data distribution, type, row size, machine power, SSD vs HD can affect which is the “best plan”.
insert into foo (id, created_at, updated_at) select generate_series(1, 4000000),
generate_series('2010-01-01 00:00:00'::timestamp, now(), ('2010-01-01 00:00:00'::timestamp - now())/4000000),
generate_series('2010-01-01 00:00:00'::timestamp, now(), ('2010-01-01 00:00:00'::timestamp - now())/4000000);
cluster foo using foo_organization_id_idx;
vacuum analyze;
Clustered by organization, the best index is organization_id_idx;> So it takes time to get new stuff in.
It's true, I discovered this problem in PG 9, and it's true in PG 16, if I'm not mistaken.
In all my queries, the correct index is in the where clause, not the order by clause: When I removed the use of the wrong index, (ORDER BY update_at + range '0 day' forces the use of the correct index), the query used less resources and was much faster.
Of course, there may be cases where the index in the order by clause is the best one to use, but in my use this never happened.
Limit (cost=0.42..3.26 rows=10 width=24) (actual time=0.013..0.024 rows=10 loops=1)
-> Index Scan using foo_organization_id_updated_at_idx on foo (cost=0.42..2011.50 rows=7063 width=24) (actual time=0.012..0.023 rows=10 loops=1)
Index Cond: (organization_id = 1)
Planning Time: 0.154 ms
Execution Time: 0.033 ms
Now the plan is using Index Cond, not filter.Of course they are also guilty. LE isn't the most to blame in reality, it's just an example that old hardware isn't important to decision makers.
LetsEncrypt is stopping serving Android 7 this year. Android 7 will be blocked from 19% of the web: https://letsencrypt.org/2023/07/10/cross-sign-expiration The option is to install Firefox.
Users with old hardware are poor people. Nobody wants poor people around, not even using their website.
“Fuck the user”, that's what we heard from a PO when we tried to defend users, imagine if we tried to defend poor users.
I can run EXPLAIN and paste it here, but it's just one of the problems with the planner (in a very basic query), I have many other problems with it.
On the other hand, I've never had any other serious problems with Postgres. It's a very good database.
I have many other problems with the planner, this is the most absurd due to the simplicity of the query.
I agree. My problem is that SQLite, an embedded database, seems to have a better Planner/Optimizer than Postgres.
Is the development of Planner/Optimizer abandoned?
> my problem with it is that it relies on cost config parameters
And I don't have access to change it, as it's a PASS database...
I did
> Postgres doesn’t automatically create indexes
Both fields have indexes (created manually). Postgres is incorrectly choosing the index in order by column, not the index in the where clause.
Yes. But other databases (SQLlite, etc.) select the correct index, without the need to create an index with both columns.
SELECT * FROM TABLE FOO WHERE ORGANIZATION_ID = 10 ORDER BY CREATED_AT LIMIT 10 OFFSET 0;
Postgres sorts by created_at using an index, but uses the filter on organization_id. This organization has a million rows... without the order, the query runs in ms. In order, in seconds/minutes.
Sometimes the plan changes if you change the query offset!
For organization 10, the plane is goood, for organization 11, the plane is bad...
Change stats, add more stats, fill the void. that doesn't solve anything. The solution is to use a calc on order by , but in the end you need to create an index using Organization_id and created_at to really fix it.
I did the same test on SQLServer and SQLite, they executed the query correctly, using the correct index. I've never created an index to fix a bad plan in SQLServer, and I've used SqlServer a lot more than Postgres.
And I use a Pass database, it's impossible to install extensions...
I'm going to test this extension locally, if it works I'll convince the company to use it (by changing the database provider)