@
@
@Twitt2017-10-22 16:34:50
MySQL
@Twitt, 2017-10-22 16:34:50

How to select records from this table in a smart way?

There is a table. It stores under 200,000 records. There is a column that is responsible for the category. Here, I need to take those lines in which the value of the category column is included in 7,9,20. But besides, the matter is that 200 records. Approximately 140k records will be selected from here if I make a query like this:

select url, name, surname, ... from table1 where category in (7,9,20);

While it will all be selected, it writes that the memory has ended. And I just need to select in one array the values ​​\u200b\u200bthat are included in, for example, category 7. in another array, what is in category 9, in the third - what is in category 20. The point is that in category 9 there are just 100k records and from it chooses for a very long time. Essence of a question: whether it is possible to make somehow so that the higher request was more optimal?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-10-22
@BuriK666

https://dev.mysql.com/doc/refman/5.7/en/mysql-inde...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question