Maximum length of an SQL Query
问题 SELECT f.* FROM feeds f, user_feeds uf WHERE (f.id=uf.feed_id and uf.user_id in (1,2,5,6,23,45)) ORDER BY created_at DESC This is a query used to construct a user's feeds. The issue I have with this query is that the "uf.user_id in ()" increases as the number of users he follows increase. What is the allowed max length of an SQL query ? Is there a better way to implement my above query ? Note: I am using ActiveRecord. And I am using Postgres. 回答1: The maximum length of a query that PostgreSQL