Skip to content

FIREFLY-2059: Table query optimization#1982

Open
loitly wants to merge 1 commit into
devfrom
FIREFLY-2059-table-query-optimization
Open

FIREFLY-2059: Table query optimization#1982
loitly wants to merge 1 commit into
devfrom
FIREFLY-2059-table-query-optimization

Conversation

@loitly

@loitly loitly commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-2059

  • Root problem: every sort/filter fully copied every column of every matching row into a new table
  • Thin index instead of full copy: store just (ROW_IDX, ROW_NUM) for the resultset, cheap regardless of table width.
  • Resultset as a view joining that index to DATA, projecting only requested columns, so every existing consumer keeps working unchanged.
  • Healpix index kept separate: its own small (ROW_IDX, pixel) table, computed once and joined at query time, instead of a persisted column on the shared resultset

Test: https://firefly-2059-table-query-optimization.irsakubedev.ipac.caltech.edu/firefly/
Compare this with the nightly build: https://firefly.irsakubedev.ipac.caltech.edu/firefly/

Try this: 10 million rows, 150 columns. The same FITS table converted into parquet to avoid high memory usage during loading. https://irsawebdev1.ipac.caltech.edu:9201/test-data/10m-150col.parquet
You’ll notice a significant performance improvement during sorting and filtering.

These smaller tables work smoothly.
https://irsawebdev1.ipac.caltech.edu:9201/test-data/table_1mil.parquet
https://irsawebdev1.ipac.caltech.edu:9201/test-data/wise-1_6-million.tbl

- Root problem: every sort/filter fully copied every column of every
  matching row into a new table
- Thin index instead of full copy: store just (ROW_IDX, ROW_NUM) for
  the resultset, cheap regardless of table width.
- Resultset as a view joining that index to DATA, projecting only
  requested columns, so every existing consumer keeps working
  unchanged.
- Healpix index kept separate: its own small (ROW_IDX, pixel) table,
  computed once and joined at query time, instead of a persisted
  column on the shared resultset
@loitly loitly added this to the 2026.2 milestone Jul 17, 2026
@loitly
loitly requested a review from robyww July 17, 2026 20:46
@loitly loitly self-assigned this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant