Should I sub-sample very large datasets to run the Kolmogorov-Smirnov (KS) test? I have two lists with many millions of values (one has 21,410,024,757 values and the other 10,561,427 values). When I run the two-sample KS test the p-value is 0, but many posts suggest that for such large datasets the KS test isn't reliable, e.g:
Kolmogorov-Smirnov test statistic interpretation with large samples
Is it a good approach to sub-sample the two lists of values randomly and uniformly?

The problem with your proposed solution is that there is no good way to determine how much downsampling you should do to get the "right" answer.  Reducing the sample size will reduce the power of the test, but you have no idea how much reduction is needed.  The deeper problem is that the K-S test is telling you whether there is statistical evidence for a difference between the distributions, but what you want to know is, whether the difference is important enough to be concerned about it.  The K-S test can't tell you this.
The first thing you are going to have to do to answer that question is to decide what kinds of differences you care about.  Do you want to know if the means are different?  The variances?  The 95th percentiles?  Statistics can't answer this for you.  You have to do some thinking about what kinds of differences would cause you to do something different in your business.  Then devise tests for those differences specifically.
What form the tests you are looking for are going to take depends a little on what kinds of differences you are looking for, but generally speaking you are going to want to avoid hypothesis tests and look for estimates of confidence intervals for the population parameters you are interested in.  So, for example, if you are interested in whether the mean of one distribution exceeds the other by some particular margin (which you have predetermined is relevant to your business use), you might start with the standard error of the means of the distributions and use them to estimate the standard error of the difference between the means.  If you're interested in something more esoteric, you might have to fit some parametric distributions to the data, or use a bootstrap Monte Carlo.  Whatever you method you pick, you will need to keep its assumptions and limitations in mind and make reasonably certain that your data doesn't violate them.
The most important thing, however, is to start by thinking about what it is you are really looking for.  Why do you care whether the distributions are different?  Trying to run statistical tests before you've thought about that is futile.
