Skip to content

Minor updates#168

Open
asad-awadia wants to merge 6 commits into
ostafen:v2from
asad-awadia:antigravity
Open

Minor updates#168
asad-awadia wants to merge 6 commits into
ostafen:v2from
asad-awadia:antigravity

Conversation

@asad-awadia
Copy link
Copy Markdown

This PR introduces changes to CloverDB, focusing on compound indexing, advanced query planning, and a more expressive update API.

Key Changes

1. Compound Indexing Support

  • Multi-field Indexes: The indexing system now supports creating, checking, and dropping indexes on multiple fields.
  • API Updates: CreateIndex, HasIndex, and DropIndex now accept variadic field arguments.
  • Planning: The query planner can now leverage compound indexes for range queries and sorting.

2. Advanced Query Planning & Execution

  • Logical OR Support: Implemented unionNode to handle queries with OR criteria efficiently using multiple index scans.
  • Index Intersection: Implemented intersectionNode to combine results from multiple independent indexes, improving query performance for complex criteria.
  • Sorting Optimizations: Improved index selection for sorted queries.
  • On-Disk Sort: Introduced onDiskSortNode for handling large result sets that exceed memory limits during sorting.

3. Rich Update API (Update Operators)

  • MongoDB-like Operators: Added support for update operators:
    • Set(field, value): Sets a field to a specific value.
    • Unset(field): Removes a field from the document.
    • Inc(field, value): Increments a numeric field.
    • Push(field, value): Appends a value to an array field.
  • Fluent Update API: The Update method now accepts these operators, allowing for atomic-like updates on documents.

4. API Enhancements & Refactoring

  • Update Return Values: Update and UpdateFunc now return the list of affected document IDs and the total count, providing better feedback for write operations.
  • Document Logic: Added helper methods in document/document.go and util/ for better document manipulation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant