C
C
coderisimo2016-01-22 12:43:29
MySQL
coderisimo, 2016-01-22 12:43:29

How to improve SQL query performance?

There is a request -

SELECT * FROM all_data ad INNER JOIN required r ON ad.isbn=r.required_isbn

in the first table 800k, in the second 300k. There are indexes on isbn and required_isbn.
i.e. I need to get only those rows from the first table whose isbn values ​​match the required_isbn from the second.
it is normal that the request tupit? when outputting 1000 lines is not a problem. But how to "announce the entire list" (c)?
Thanks

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Lebedev, 2016-01-22
@swanrnd

Where should such requests be made?
The problem here is architecture.
It's one thing if it's rare, but it's another thing if it's constant.

K
kretsu, 2016-01-22
@kretsu

And you can find out what tupit means?
As I understand it is necessary to return the full result of the request? Could this be a slow I/O problem?

D
Dmitry Kovalsky, 2016-01-22
@dmitryKovalskiy

The script is nowhere simpler and it is difficult to advise without a table structure. Depending on what is stored in the tables - I would remove the asterisk and clearly list the data to be returned (100% you return the same identifier twice)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question