From a36a173428fce00115a4e922263c2e9debcf01ba Mon Sep 17 00:00:00 2001 From: roger2hk Date: Thu, 25 Jul 2024 15:27:21 +0000 Subject: [PATCH] Add a TODO to refactor how we fetch tiles during integrate --- storage/mysql/mysql.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/mysql/mysql.go b/storage/mysql/mysql.go index 657d6993..8ef69cc5 100644 --- a/storage/mysql/mysql.go +++ b/storage/mysql/mysql.go @@ -248,12 +248,13 @@ func (s *Storage) sequenceBatch(ctx context.Context, entries []*tessera.Entry) e func (s *Storage) integrate(ctx context.Context, tx *sql.Tx, fromSeq uint64, entries []*tessera.Entry) error { tb := storage.NewTreeBuilder(func(ctx context.Context, tileIDs []storage.TileID, treeSize uint64) ([]*api.HashTile, error) { r := make([]*api.HashTile, len(tileIDs)) + + // TODO(#21): Refactor the following to fully utilise the MySQL for fetching multiple tiles in one query with the same ordering. errG := errgroup.Group{} for i, id := range tileIDs { i := i id := id errG.Go(func() error { - // TODO: Refactor the query into a function. row := tx.QueryRowContext(ctx, selectSubtreeByLevelAndIndexSQL, id.Level, id.Index) if err := row.Err(); err != nil { return err