Azure / Azure/data-api-builder

Sql: Improve bootstrap performance by getting all the metadata information in one go from the db

Open
#381 0 comments 1 reaction 0 assignees View on GitHub
enhancement mssql pgsql mysql perf pgsql
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 22h
Merged PRs (30d)
9

Description

In `SqlMetadataProvider`, we use different methods to collect metadata information from the underlying database object source:
1) a DbDataAdapter to get table columns, their type, and primary key
2) GetSchema on Columns to find out if each column has Default value or not.
3) Use a ForeignKey Query to derive the referenced table, and the referenced columns.

This involves multiple round trips to the database.
This issue is to investigate if we can optimize this bootstrap to acquire all this information in a single roundtrip.

Contributor guide

Open the contributing guide

Research direction

Start by locating SqlMetadataProvider and tracing its DbDataAdapter, GetSchema on Columns, and ForeignKey Query paths. Determine whether the database can provide columns, types, primary keys, defaults, and foreign-key references together, then verify the bootstrap preserves all metadata while reducing database round trips to one.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
backend-api-design, databases, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.