When the same query gets a different plan on two servers, a changed setting is high on my list of suspects. EXPLAIN can show them in the plan itself.
SET random_page_cost = 1.1;
EXPLAIN (SETTINGS) SELECT * FROM my_table WHERE id = 42;
With SETTINGS on, the plan gets an extra Settings: line. The docs say it includes the options that affect query planning with a value different from the built-in default. So here you would see random_page_cost in the output, and nothing at all if everything is at its default. The option defaults to false.
That makes plans easier to compare when you paste them into a ticket or send them to a colleague. The settings travel with the plan, so nobody has to guess whether work_mem or enable_seqscan was changed on that session.
The caveat is the word planning: settings that don’t influence the planner are not listed, and neither are defaults. It is also not a full dump of your configuration. For that, query the pg_settings view and check the source column. You can combine it with other options, for example EXPLAIN (ANALYZE, BUFFERS, SETTINGS).
Further reading: EXPLAIN