ydb-embedded-ui icon indicating copy to clipboard operation
ydb-embedded-ui copied to clipboard

Optimise query results

Open artemmufazalov opened this issue 2 years ago • 3 comments

Currently on very big datasets in results or with big request stats some use cases are very slow and could take up to 2-3 seconds 😱. Big stats are quite a common thing for requests with multi schema.

Use cases:

  1. Switching from History or Saved tab to Query tab if there are some results
  2. Switching to results from stats and vice versa

What could be done:

  1. Keep rendered elements on screen (for example with display: none), so they won't be calculated again. Applicable to result tables, stats, ast, explain plan and Fullscreen component
  2. Optimise data calculations and rendering

Migrating QueryEditor files to TS is essential for this issue: https://github.com/ydb-platform/ydb-embedded-ui/issues/619


Inspired by: https://github.com/ydb-platform/ydb-embedded-ui/pull/595#discussion_r1403494080

artemmufazalov avatar Dec 21 '23 13:12 artemmufazalov

@Raubzeug please link this one to a ticket about migration

antonkovalenko avatar Sep 30 '24 08:09 antonkovalenko

@antonkovalenko I've double checked the situation, and it still needs some improvements. Huge tables are re-rendering every time we return to the tab with results (or switch to Fullscreen). Let's evaluate this issue as is.

Raubzeug avatar Oct 02 '24 12:10 Raubzeug

@Raubzeug please add a screencast and a new issue about json inspector #1388

antonkovalenko avatar Oct 07 '24 09:10 antonkovalenko

Query result table optimization

With dynamicRenderType: 'variable' and dynamicItemSizeGetter table renders all its cells, it causes performance issues on big tables.

Rendering of a query result table with 100 000 rows.

With dynamicRenderType: 'variable' and dynamicItemSizeGetter: 100_000 before

With 'uniform' rendering: 100_000 after

I'm not sure what is exactly the key reason here, it may be dynamicItemSizeGetter which makes react-list check hasDeterminateSize to be true (https://github.com/caseywebdev/react-list/blob/master/react-list.es6#L246) or it may be 'variable' render type itself

artemmufazalov avatar Nov 26 '24 13:11 artemmufazalov

For tables, where 'uniform' rendering is not possible, result limiting is required: https://github.com/ydb-platform/ydb-embedded-ui/issues/1700

artemmufazalov avatar Nov 26 '24 13:11 artemmufazalov