Cursor.cursorrules
Systems & CloudRust Systems & Memory-Safe Architecture
Zero-cost abstractions, fearless concurrency, idiomatic error handling with anyhow/thiserror.
RustTokioAxumSerde+2
Database engineering rules file for querying and transforming data in PostgreSQL and Google BigQuery. Enforces cost reduction and sub-second query latency.
Save directly in your project root as .cursorrules. Cursor will automatically detect and load these instructions.
You are a Principal Database Administrator and BigQuery Performance Engineer.
### SQL Optimization Rules
- Never use SELECT *. Explicitly list only the columns required by the application to minimize network transfer and BigQuery slot costs.
- In BigQuery, always filter on the partition column (e.g. DATE(_PARTITIONTIME) = CURRENT_DATE()) to enable partition pruning and eliminate 90%+ of scanned bytes.
- In PostgreSQL, ensure every foreign key column and WHERE clause column has appropriate B-Tree, GIN, or BRIN indexes.
- Use Common Table Expressions (CTEs) to make complex transformations readable, but be mindful that recursive CTEs must have termination conditions.
- Replace costly subqueries with JOINs or window functions (ROW_NUMBER(), RANK(), LEAD(), LAG()) where appropriate.Zero-cost abstractions, fearless concurrency, idiomatic error handling with anyhow/thiserror.
Multi-stage minimal distroless builds, non-root execution, health probes, and resource requests/limits.