Skip to content

fix: add composite indexes for split-horizon DNS queries#147

Merged
poyrazK merged 1 commit intomainfrom
fix/composite-index-split-horizon
May 7, 2026
Merged

fix: add composite indexes for split-horizon DNS queries#147
poyrazK merged 1 commit intomainfrom
fix/composite-index-split-horizon

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented May 7, 2026

Summary

  • Add composite indexes to schema.sql for common tenant-scoped DNS query patterns
  • idx_dns_records_zone_name_type on (zone_id, LOWER(name), type) — covers DeleteRecordsByNameAndType
  • idx_dns_records_zone_name on (zone_id, LOWER(name)) — covers DeleteRecordsByName
  • idx_dns_records_zone_id on (zone_id) — covers DeleteRecordsForZone bulk deletes
  • idx_dns_zones_tenant_id on (tenant_id) — covers ListZones tenant isolation

Fixes: #71

Adds four indexes to schema.sql for common query patterns:
- idx_dns_records_zone_name_type (zone_id, LOWER(name), type)
- idx_dns_records_zone_name (zone_id, LOWER(name))
- idx_dns_records_zone_id (zone_id)
- idx_dns_zones_tenant_id (tenant_id)

Fixes: #71
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 15 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21208934-83c0-4357-81cf-be425d83f170

📥 Commits

Reviewing files that changed from the base of the PR and between c8372fe and 5adfbd7.

📒 Files selected for processing (1)
  • internal/adapters/repository/schema.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/composite-index-split-horizon

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay to merge

@poyrazK poyrazK merged commit 78529b5 into main May 7, 2026
7 checks passed
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.

Missing composite index for split-horizon DNS queries

1 participant