fix: remove dangerous count methods from interface
- Removed countNouns() and countVerbs() from BaseStorageAdapter
- These methods would be dangerous with millions of entries
- We already have incremental statistics tracking via incrementStatistic()
- Statistics are maintained in cache and updated as items are added/removed
- Much more scalable than iterating through all items
The existing statistics system is the proper way to get counts:
- Uses incrementStatistic('noun'/'verb', service) on add
- Uses decrementStatistic() on delete
- Access via getStatistics() which returns cached counts
- No iteration through millions of items needed
This commit is contained in:
parent
04549aec2d
commit
f22c60eb66
1 changed files with 0 additions and 18 deletions
|
|
@ -145,24 +145,6 @@ export abstract class BaseStorageAdapter implements StorageAdapter {
|
||||||
nextCursor?: string
|
nextCursor?: string
|
||||||
}>
|
}>
|
||||||
|
|
||||||
/**
|
|
||||||
* Count total number of nouns (optional)
|
|
||||||
* WARNING: Implementations should be efficient for large datasets.
|
|
||||||
* Consider caching counts or using database COUNT operations.
|
|
||||||
* @param filter Optional filter criteria
|
|
||||||
* @returns Promise that resolves to the count
|
|
||||||
*/
|
|
||||||
countNouns?(filter?: any): Promise<number>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Count total number of verbs (optional)
|
|
||||||
* WARNING: Implementations should be efficient for large datasets.
|
|
||||||
* Consider caching counts or using database COUNT operations.
|
|
||||||
* @param filter Optional filter criteria
|
|
||||||
* @returns Promise that resolves to the count
|
|
||||||
*/
|
|
||||||
countVerbs?(filter?: any): Promise<number>
|
|
||||||
|
|
||||||
// Statistics cache
|
// Statistics cache
|
||||||
protected statisticsCache: StatisticsData | null = null
|
protected statisticsCache: StatisticsData | null = null
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue