21 pointsby luu2 days ago1 comment
  • tmoertel8 hours ago
    Tl;dr: The trouble with ntile seems to be that, when the author of the post imagined what it did based solely on its name and she imagined wrong, she ran with her imaginary version way too long before checking the documentation, which was very clear about its behavior:

    > Unlike other ranking functions, ntile() ignores ties: it will create evenly sized buckets even if the same value of x ends up in different buckets.

    • setr2 hours ago
      I’m pretty sure NTILE is just a generally cursed function. SQL NTILE also requires everything to be loaded in memory because of the odd rule that larger buckets precede smaller buckets, so it’s unusable on anything decently sized.

      Not being able to specify how ties are handled (and choosing, as far as I can tell, a fairly useless definition) fits the bill.