Skip to content

Feature: show index advisor in table editor#41166

Merged
awaseem merged 17 commits into
masterfrom
aliwaseem/fe-2215-poc-surface-index-advisor-insights-in-table-editor
Dec 10, 2025
Merged

Feature: show index advisor in table editor#41166
awaseem merged 17 commits into
masterfrom
aliwaseem/fe-2215-poc-surface-index-advisor-insights-in-table-editor

Conversation

@awaseem

@awaseem awaseem commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

What's changed

  • Clean up for query index (added types, scrollable on overflow, etc)
  • New button in table editor to enable advisors, behaves the exact same as the RLS button
  • New icon on slow column
  • Behind a flag (ON in staging/local, OFF in prod)

How to test

Make sure index advisor is enabled first, you can do this from the table editor or query performance page!

Create a table with no indexes and add some rows:

-- Create sample table without indexes
CREATE TABLE public.sample_no_index (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  username text,
  email text,
  created_at timestamptz DEFAULT now(),
  profile jsonb,
  value numeric
);

-- Insert generated data (1000 rows)
INSERT INTO public.sample_no_index (username, email, profile, value)
SELECT
  'user_' || seq AS username,
  'user_' || seq || '@example.com' AS email,
  jsonb_build_object('bio', 'This is user ' || seq, 'tags', to_jsonb(ARRAY['tag' || (seq % 5)])) AS profile,
  (random()*1000)::numeric(10,2) AS value
FROM generate_series(1,1000) AS seq;

-- Quick count to validate
SELECT count(*) AS row_count FROM public.sample_no_index;

Then run a select query a bunch of times (maybe 20) aganist the table:

  SELECT *
  FROM public.sample_no_index
  WHERE email = 'user_788@example.com'

@awaseem awaseem requested a review from a team as a code owner December 8, 2025 18:56
@vercel

vercel Bot commented Dec 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cms Ready Ready Preview Comment Dec 10, 2025 4:09pm
design-system Ready Ready Preview Comment Dec 10, 2025 4:09pm
docs Ready Ready Preview Comment Dec 10, 2025 4:09pm
studio-self-hosted Ready Ready Preview Comment Dec 10, 2025 4:09pm
studio-staging Ready Ready Preview Comment Dec 10, 2025 4:09pm
ui-library Ready Ready Preview Comment Dec 10, 2025 4:09pm
zone-www-dot-com Ready Ready Preview Comment Dec 10, 2025 4:09pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
studio Ignored Ignored Dec 10, 2025 4:09pm

@awaseem awaseem marked this pull request as draft December 8, 2025 18:56
@supabase

supabase Bot commented Dec 8, 2025

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@awaseem

awaseem commented Dec 8, 2025

Copy link
Copy Markdown
Contributor Author

The context things is a bit unneeded, just trying to rush out a POC

@coveralls

coveralls commented Dec 8, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 68.471%. remained the same
when pulling fe49a7c on aliwaseem/fe-2215-poc-surface-index-advisor-insights-in-table-editor
into f01dedd on master.

@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  60 passed
flaky  3 flaky

Details

stats  63 tests across 10 suites
duration  9 minutes, 35 seconds
commit  fe49a7c

Flaky tests

Features › database.spec.ts › Database › Tables › CRUD operations and copy works as expected
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected

const escapedSchema = schema.replace(/'/g, "''")
const escapedTable = table.replace(/'/g, "''")

return /* SQL */ `

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used AI to help me out here, worth a second look for any funkiness

@awaseem awaseem changed the title Draft: POC show index advisor in table editor Feature: show index advisor in table editor Dec 9, 2025
@awaseem awaseem marked this pull request as ready for review December 9, 2025 17:57

interface QueryIndexesProps {
selectedRow: any
selectedRow: Pick<QueryPerformanceRow, 'query'>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any is my new hatred

@kemaldotearth kemaldotearth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small footer thing on the panel, tiny gap at the bottom. There must be a parent class missing somewhere?

CleanShot.2025-12-09.at.18.06.00.mp4

@awaseem awaseem requested review from a team and kemaldotearth December 9, 2025 19:03
@awaseem

awaseem commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

Addressed feedback @kemaldotearth

Comment thread apps/studio/data/database/table-index-advisor-query.ts Outdated
awaseem and others added 2 commits December 9, 2025 13:54
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
@awaseem awaseem merged commit e7a4ca9 into master Dec 10, 2025
22 checks passed
@awaseem awaseem deleted the aliwaseem/fe-2215-poc-surface-index-advisor-insights-in-table-editor branch December 10, 2025 16:28
stylessh pushed a commit that referenced this pull request Dec 11, 2025
* added table advisor query

* updated to include table editor performance

* updated JSON B

* added side panel

* updated query indexes to show highlights context

* show index advisor in table editor

* updated invalidation logic

* added color updates

* added query indexes

* updated query performance type

* updated overflow and title

* put behind flag

* remove gap

* added on close

* Update apps/studio/data/database/table-index-advisor-query.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* updated styling

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
stylessh added a commit that referenced this pull request Dec 16, 2025
* wip

* wip

* single page

* new sections and polishing up

* reponsive

* nits

* semantic titles

* optimize imgs

* nits

* wup

* hero bubbles

* Update apps/www/components/Wrapped/Pages/SupabaseSelect.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Use `amaro` for stripping types in code samples (#41229)

* Fix the error for babel/preset-typescript in docs.

* Unfix the version.

* Try using amaro for type stripping.

* Run prettier after stripping types.

* Fix tests.

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>

* fix: Fix minor issue in the foreign key selector (#41235)

Change the isPending state to isLoading.

* docs: Remove empty troubleshooting fields (#41236)

* Remove emoty fields

* Fix lock file

* chore: update self-hosted image versions (#41234)

* Feature: show index advisor in table editor (#41166)

* added table advisor query

* updated to include table editor performance

* updated JSON B

* added side panel

* updated query indexes to show highlights context

* show index advisor in table editor

* updated invalidation logic

* added color updates

* added query indexes

* updated query performance type

* updated overflow and title

* put behind flag

* remove gap

* added on close

* Update apps/studio/data/database/table-index-advisor-query.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* updated styling

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* fix: useFlag to update initial check of flag store (#41209)

* fix flag lib

* updated uneeded logic

* updated logic

* remove line

* updated comment

* fix: Hide favourites and share snippets on self-hosted variant (#41227)

* Hide favorite and share actions for self-hosted version.

* Rename the query on save only on platform.

* Simplify useCheckOpenAiKeyQuery.

* Rename with AI now depends if the OPENAI_API_KEY is set.

* Minor fixes.

* Fix the tests to use .skip for skipping tests. Remove extra port params.

* Make the test for favourites work only on platform variant.

* feat(reports): support new database report granularity FE-2221 (#41228)

* handle new granularity

* undo unnecessary type change

* rm console log

* fix: blog auto scroll post app router migration for blog (#41220)

Enhance TOC highlighting and anchor scroll in blog posts

Refactored useActiveAnchors hook to support smooth hash scrolling and improved TOC highlighting based on scroll position. Added options for custom selectors and offset, and updated BlogPostClient to enable scroll-to-anchor and TOC highlight functionality.

* fix: remove flakiness with launch options and default timeouts (#41245)

* attempt to make table editor tests less flaky

* updated race conditions for table editor

* updated playwright config with optimized launch options

* reduce workers

* updated timeouts for tests

* updated config to have a global timeout of 20 seconds

* updated to be visible

* chore: update changelog and image versions file (#41244)

* feat(design-system): improve table docs (#41215)

* docs updates

* docs expansion

* minor docs fix

* improvements

* fix dependencies

* docs expansion

* more table examples

* map over data

* improve copy

* Update apps/design-system/registry/default/example/table-row-link-actions.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update apps/design-system/registry/default/example/table-row-link-actions.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fixes

* fix

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore(studio): improve table presentation (#41217)

* billing improvements

* wrapper improvements

* border fix

* Nit adjustments

* fixes

* fix aria

* fix loading

* fixes

* fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>

* Save opened side bar in local storage, and init on new session (#41224)

* Save opened side bar in local storage, and init on new session

* Fix test

* Fix

* Nit

* docs(design-system): Data Table and Data Grid documentation (#41252)

* basic differentiation

* docs

* data-grid examples

* data-grid-demo

* data-table

* demo

* use existing components

* improvements

* markup

* docs

* remove data table

* lint

* Update apps/design-system/content/docs/ui-patterns/empty-states.mdx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix ref

* use TanStack sorting

* grammar

* dependency

* 📝 Add docstrings to `dnywh/docs/data-table-data-grid` (#41255)

Docstrings generation was requested by @MildTomato.

* #41252 (comment)

The following files were modified:

* `apps/design-system/registry/default/example/data-grid-demo.tsx`
* `apps/design-system/registry/default/example/data-grid-empty-state.tsx`
* `apps/design-system/registry/default/example/data-table-demo.tsx`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* docs: fix grammatical error in generate-text-embeddings guide (#41187)

* docs: fix grammatical error in generate-text-embeddings guide

* Update generate-text-embeddings.mdx

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>

---------

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>

* chore: uniform card and panel padding-x (#41237)

* docs: Fix typo in API introduction documentation (#41251)

* chore(billing): regenerate api-types to include vanity subdomain entitlement (#41257)

chore(billing: regenerate api-types to include vanity subdomain entitlement

* Add liam to humans.txt (#41169)

* docs: Add link to restoring backup to new Supabase project (#39108)

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>

* feat(code-block): add word wrap functionality and controls to code bl… (#39689)

* feat(code-block): add word wrap functionality and controls to code blocks

* feat(code-block): enhance layout of code block with improved line number display and structure

* fix h-full issue

* fix Prettier issue

---------

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>

* wip

* wip

* single page

* optimize imgs

* revert

* pkg

* update new content

* rm overflow

* new data

* nits

* nits

* og

* border

* fix: improve AnimatedCounter and FloatingStatBubbles/Intro components

- Update AnimatedCounter to correctly reflect value changes in the DOM.
- Add lifetime management for timers in FloatingStatBubbles and FloatingBoxes to prevent memory leaks.
- Ensure cleanup of timers on component unmount for better resource management.

* dbs

* minify images

* text-brand-link on light mode

* fix grid

* max-width on images

* address comments

* fixes

* faster image rotation

* upd og

* new launch

* nitsgs

* last nits

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
Co-authored-by: Andrey A. <56412611+aantti@users.noreply.github.com>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
Co-authored-by: Jordi Enric <37541088+jordienr@users.noreply.github.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Dinesh Dawonauth <dineshddawo@gmail.com>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: 李子衿 <160584929+hhhez@users.noreply.github.com>
Co-authored-by: Kanishk Dudeja <kanishk@kanishkdudeja.com>
Co-authored-by: lch-supa <liam.hogan@supabase.io>
Co-authored-by: Timothy Lim <tim.lim@supabase.io>
Co-authored-by: Priyanshu Thapliyal <114170980+Priyanshuthapliyal2005@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants