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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
5 additions and
1 deletions
-
CHANGELOG.md
-
apps/api/src/app/endpoints/watchlist/watchlist.service.ts
-
prisma/migrations/20260919000000_removed_index_for_market_price_from_market_data/migration.sql
-
prisma/schema.prisma
|
|
|
@ -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`) |
|
|
|
|
|
|
|
@ -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']> { |
|
|
|
|
|
|
|
@ -0,0 +1,2 @@ |
|
|
|
-- DropIndex |
|
|
|
DROP INDEX "MarketData_marketPrice_idx"; |
|
|
|
@ -172,7 +172,6 @@ model MarketData { |
|
|
|
@@index([dataSource]) |
|
|
|
@@index([dataSource, symbol]) |
|
|
|
@@index([date]) |
|
|
|
@@index([marketPrice]) |
|
|
|
@@index([state]) |
|
|
|
@@index([symbol]) |
|
|
|
} |
|
|
|
|