If all posts have exactly the same publication date/time, to the second, what order are they listed in the main query?

In short, it’s implementation-dependant. See:

The MySQL 8 ref manual here also stated that:

On character type columns, sorting—like all other comparison operations—is normally performed in a case-insensitive fashion. This
means that the order is undefined for columns that are identical
except for their case. You can force a case-sensitive sort for a
column by using BINARY like so: ORDER BY BINARY col_name.

A second column can be specified, e.g. ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC, but WordPress doesn’t do that by default.

I made a demo on DB Fiddle which demonstrates the above “normally performed in a case-insensitive fashion” and the “2nd column” thing.

  • At the time of writing, DB Fiddle seemed to be using the PK (primary key) column to sort columns that are identical (see Query #1 in another demo here). My test site also seemed to be doing the same (🤔), see screenshot 1 and screenshot 2.

So, that might also be the case with your RDBMS/hosting, but you would need to consult your hosting support regarding that.

tech