Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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).

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

It's a little different in my case Go to -> MySQL Workbench -> Edit Menu -> preferences -> SQL Editor -> SQL Execution -> Uncheck 'Limit Rows'.

In the screenshot attached, the limit disabling checkbox can be seen.

In the screenshot attached, the limit disabling checkbox can be seen.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top