Browse Source

Task/improve watchlist performance by removing market price index of market data database table (#7907)

* Improve watchlist performance

* Update changelog
pull/7909/head
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
72f11a8c82
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      apps/api/src/app/endpoints/watchlist/watchlist.service.ts
  3. 2
      prisma/migrations/20260919000000_removed_index_for_market_price_from_market_data/migration.sql
  4. 1
      prisma/schema.prisma

1
CHANGELOG.md

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Localized the default account name created during user registration
- Improved the performance of the watchlist by removing an unnecessary index from the market data table
- Improved the performance of deleting a watchlist item
- Extended the `POST api/v1/user` endpoint by the language code
- Improved the language localization for German (`de`)

2
apps/api/src/app/endpoints/watchlist/watchlist.service.ts

@ -1,3 +1,4 @@
import { LogPerformance } from '@ghostfolio/api/interceptors/performance-logging/performance-logging.interceptor';
import { BenchmarkService } from '@ghostfolio/api/services/benchmark/benchmark.service';
import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service';
import { MarketDataService } from '@ghostfolio/api/services/market-data/market-data.service';
@ -88,6 +89,7 @@ export class WatchlistService {
});
}
@LogPerformance
public async getWatchlistItems(
userId: string
): Promise<WatchlistResponse['watchlist']> {

2
prisma/migrations/20260919000000_removed_index_for_market_price_from_market_data/migration.sql

@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX "MarketData_marketPrice_idx";

1
prisma/schema.prisma

@ -172,7 +172,6 @@ model MarketData {
@@index([dataSource])
@@index([dataSource, symbol])
@@index([date])
@@index([marketPrice])
@@index([state])
@@index([symbol])
}

Loading…
Cancel
Save