M
M
marselabdullin2020-08-07 18:20:50
SQL
marselabdullin, 2020-08-07 18:20:50

Join optimization?

There is a view/view. In fact, the view code contains several joins of the table itself.

Recently, queries to select data from this view have become very long, which slows down the speed of updating reports.

What actions should be taken to speed up getting selections from this view?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
John Didact, 2020-08-07
@marselabdullin

Personally, I decided for myself that instead of complex joins, it is better to use several queries.
Well, first of all, it is worth putting down indexes to what you are joining on. And, it is desirable that this data be in int, etc. (numeric) and did not have a NULL value (namely, a field in NOT NULL) It is
also worth reading about EXPLAINand how to understand his answer .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question