Q
Q
Qwyu_4iLofK2022-02-07 21:01:58
MySQL
Qwyu_4iLofK, 2022-02-07 21:01:58

Is it possible to make an index by date desc , not asc?

Good afternoon,
I really need to create an index on the desc date (I need to count 90 days ahead, every day on the previous date), so the solution to this problem is very important, the slowness goes with a terrifying progression every day:
1) I wrote before the entity:

@ORM\Table(indexes={
 *     @ORM\Index(name="date_idx", columns={"date_mod"})})

creates an index with ASC.
2) I tried to force DESC in the migration
, it is still visible in phpstorm that the index is with ASC
3) a direct query in phpstorm in the database, -> index with asc.
4) even in the admin panel (adminer.php) if you make a direct request, the index is created with asc.
what to do, I really don't know.

The direct request is:
CREATE INDEX date_idx ON mod (date_mod DESC)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2022-02-07
@vabka

Apparently, it is impossible:
https://github.com/doctrine/orm/issues/8128
I also did not find it in the documentation and on SO.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question