2014-04-05 09:05 阅读 1.0k

MySQL显示select * from有内部限制0,1000。 如何阻止它

i am accesing my Mysql database server using Mysql workbench.and i have encountered a prolem. there is a table, named tags, in my database.which will have have more than thousands of tags in future.the problem is when i am executing select * from tags; query Mysql workbench is executing this (or taking action) like select * from tags LIMIT 0, 1000. i am giving you a snapshot enter image description here

my question is how can i stop it.because when i will launch my application it will have thousands(much more than 1000) of tags.if it implies LIMIT 0, 1000 internally then my php script wont have all the tags at the time of executing my tagging system.

all i want is to have no limits on select *.how can i do that?what will be the modified Select * query not to have any limits

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • 已采纳
    duan39779 duan39779 2014-04-05 09:22

    The limit you are seeing is simply an optimisation in the workbench to attempt to limit the number of rows returned from a large table.

    When you are running a query from either the console or via code, there are no limits placed on the number or rows returned.

    On that note though, it is normally good practise to either manually limit the number of rows returned or at least process the results a single row at a time. The reason is that if you try to get all the records at once you will have to assign that resultset as much memory as the entire set will use. If you process it one row at a time, you can re-use the same memory as you go.

    点赞 评论 复制链接分享
  • dongxin5054 dongxin5054 2014-04-07 08:53

    I addition to Fluffeh's answer: you can change the limit to whatever value you want, including switching it off entirely (see the MySQL Workbench preferences).

    点赞 评论 复制链接分享
  • dongshubang7816 dongshubang7816 2017-07-05 11:57

    Go to -> MySQL Workbench -> Edit Menu -> preferences -> SQL Editor -> Query Results -> Uncheck Limit Rows.

    点赞 评论 复制链接分享