且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

postgres:从表中获取随机条目 - 太慢

更新时间:2023-11-25 21:52:22

我认为您***先选择随机对象,然后在选择这些对象后执行连接.即,查询一次以选择随机对象,然后再次查询以加入那些被选择的对象.

I'm thinking you'll be better off selecting random objects first, then performing the join to those objects after they're selected. I.e., query once to select random objects, then query again to join just those objects that were selected.