I've noticed that if I query the last 24 hours of data of a user that has been added to the system a couple days ago, it takes much less time to execute the query than if I request the same last 24 hours of a user added six months ago.

My question is: Does the indexes or the order of the statements in the WHERE clause matter in the order the data are filtered in the table? (First by user_id and then by created_at or viceversa).

My question is: Does the indexes or the order of the statements in the WHERE clause matter in the order the data are filtered in the table? (First by user_id and then by created_at or viceversa).

In general, yes. The query optimizer will look at the data distribution to pick out the "best" index. Whether that is a good choice depends entirely on the optimizer itself and the "correctness" of the data distribution that it uses. Most DBMS update statistics about your data exactly for this purpose.

Only the execution plan of the statements can show what is really going on in your case.

That's correct. No decent query optimizer should be influenced by the order in which the conditions appear in the statement.

There might be "tips" floating around in the internet which might tell the opposite, but they are usually for old optimizers that were "rule based" i.e. they were looking at the order of the joins and conditions.

Modern optimizers are all(?) cost based nowadays and they are hardly every influenced by the order of the conditions.