简体   繁体   中英

Is there any limit to the comma delimited string in find_in_set in mysql query

I want to know what is the limit of the comma delimited string passed to find_in_set() in a mysql query. I am fetching data from mysql in random order through ajax in chunks of 15 to 20 entries on scroll to bottom and I want that data without any duplication.

Mysql's documentation on find_in_set() do not mention any limit regarding the length or number of elements within a string. The mysql documentation on limitations and restrictions within mysql also do not mention any restriction on the length or number of elements within a string list.

The only limit you will probably have is the maximum length of the data type that holds a string. But with longtext fields, this limit is very high.

However, I would rather store the items in a list in theor own records.

There is no documented limit but the possibility that your query could get very slow. You can insert your data in a temp table and use that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM