Skip to content

Conversation

@thoherr
Copy link
Owner

@thoherr thoherr commented Nov 4, 2025

This migration adds 9 new indexes to optimize frequently queried columns:

Events table:

  • Composite index on (lug_id, registration_open, visible) for event listing query
  • Index on start_date for default_scope ordering

Visitors table:

  • Unique index on session_id for visitor lookup during voting

AttendeeTypes table:

  • Index on name for AttendeeType.find_by_name('Aussteller')

Exhibits table:

  • Index on is_approved for filtering approved exhibits
  • Index on is_collab for filtering collaborative exhibits
  • Index on is_installation for filtering installation exhibits
  • Index on is_part_of_installation for filtering installation parts

Attendees table:

  • Index on is_approved for filtering approved attendees

Performance Impact:

  • Event listing queries will use composite index instead of full table scan
  • Visitor session lookups will be O(1) with unique index
  • Boolean filtering on exhibits/attendees will use index lookups
  • AttendeeType name lookups will be faster with index

All tests pass: 131 runs, 374 assertions, 0 failures Coverage maintained at 95.58%

🤖 Generated with Claude Code

This migration adds 9 new indexes to optimize frequently queried columns:

Events table:
- Composite index on (lug_id, registration_open, visible) for event listing query
- Index on start_date for default_scope ordering

Visitors table:
- Unique index on session_id for visitor lookup during voting

AttendeeTypes table:
- Index on name for AttendeeType.find_by_name('Aussteller')

Exhibits table:
- Index on is_approved for filtering approved exhibits
- Index on is_collab for filtering collaborative exhibits
- Index on is_installation for filtering installation exhibits
- Index on is_part_of_installation for filtering installation parts

Attendees table:
- Index on is_approved for filtering approved attendees

Performance Impact:
- Event listing queries will use composite index instead of full table scan
- Visitor session lookups will be O(1) with unique index
- Boolean filtering on exhibits/attendees will use index lookups
- AttendeeType name lookups will be faster with index

All tests pass: 131 runs, 374 assertions, 0 failures
Coverage maintained at 95.58%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@thoherr thoherr merged commit c4d4dbf into master Nov 4, 2025
5 checks passed
@thoherr thoherr deleted the add-performance-indexes branch November 4, 2025 20:54
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.

2 participants