cuba-platform / fts

Full-Text Search Addon
https://www.cuba-platform.com/
Apache License 2.0
4 stars 1 forks source link

FTS indexing spends most of time fetching entitities one by one from database #46

Open alexbudarov opened 5 years ago

alexbudarov commented 5 years ago

Environment

Description of the bug or enhancement

FTS indexing is much slower than it could be. It spends most of time not to write lucene index, but to load entities and lazy-load entity graph from database.

CPU time distribution:

So time share to load indexed entities from DB is: (3136 + 2602 + 4351) / 14160 * 100% = 71.25%

Thus FtsManager indexing speed is limited by ping to database. On my machine it is about 1000 entities per second. For 1 million entities indexing time is about 20 minutes - which means a significant index downtime for those systems which rely on FTS search.