adamfowleruk / groundupdb

Creating a database from the ground up in C++ for fun!
Apache License 2.0
109 stars 25 forks source link

Allow app devs to minimise data retrieved from a Query #24

Open adamfowleruk opened 3 years ago

adamfowleruk commented 3 years ago

Please start with a use case description for a USER of this work [Who] As an app dev [What] I need to sometimes just return keys, sometimes metadata, and sometimes whole or partial records from the results of a Query [Value] In order to maximise the performance of data retrieval in my application

Describe the solution you'd like A modification to a Query execution to specify just what data is pre-emptively returned vs. Lazily retrieved

Describe alternatives you've considered Considered just returning a KeySet as currently, but you then don't have enough info to determine pulling back the whole record vs part of it to decide what to fetch. This would also impose n fetches, a big performance bottleneck.

Additional context May need a meta Record<KeyType,ValueType> class above EncodedValue to efficiently and specifically handle this