Skip to content

create indexes#176

Open
Oleksiy-Lyashenko wants to merge 4 commits into
mate-academy:mainfrom
Oleksiy-Lyashenko:develop
Open

create indexes#176
Oleksiy-Lyashenko wants to merge 4 commits into
mate-academy:mainfrom
Oleksiy-Lyashenko:develop

Conversation

@Oleksiy-Lyashenko
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your implementation requires changes to pass the tests. The critical issue is that indexes must be named exactly as their corresponding columns (e.g., Email, Name, CustomerID), not with prefixes like index_customers_email or index_products_name. The check runs confirm that indexes for Product.Name and Customers.Email are not being found. This happens because: 1. The test suite expects indexes named Email and Name (matching column names exactly), 2. Your current implementation uses index_customers_email and index_products_name which don't match. To fix this, update your CREATE INDEX statements to use column names directly: CREATE INDEX Email ON Customers(Email); CREATE INDEX Name ON Products(Name); Note: The third index on Orders.CustomerID also needs to be renamed from idx_orders_customer_id to CustomerID to comply with the requirement. Once you correct the index naming to match the column names exactly, the tests should pass. This is a critical requirement explicitly stated in the task checklist.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread task.sql Outdated
USE ShopDB;

create index index_products_name on Products (Name);
create index index_customers_email on Customers (Email);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Index name should be Email (matching the column name) instead of index_customers_email

Comment thread task.sql Outdated
# Write your SQL code for the database creation here. Good luck!
USE ShopDB;

create index index_products_name on Products (Name);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Index name should be Name (matching the column name) instead of index_products_name

oleksii_lyashenko added 2 commits May 30, 2026 19:50
Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

The code is missing a critical index that causes test failures. Based on the usage scenario analysis, the Orders table receives at least 100 new orders per day, meaning customer lookups on this table are frequent operations. You need to add a third index: CREATE INDEX CustomerID ON Orders(CustomerID);. Your current task.sql only has 2 of the 3 expected indexes (Email and Name), but the test suite will verify all three indexes exist. Once you add this index, your solution should pass the requirements.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread task.sql Outdated
Comment on lines +4 to +5
CREATE INDEX Name ON Products(Name);
CREATE INDEX Email ON Customers(Email); No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing index on Orders.CustomerID. The usage scenario states 'at least 100 new orders per day', which means the Orders table is heavily accessed. When the application looks up orders by customer, indexing CustomerID will optimize these queries. Add: CREATE INDEX CustomerID ON Orders(CustomerID);

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved. The task.sql file correctly implements all three required indexes with proper naming conventions: Name on Products for search functionality, Email on Customers for login operations, and CustomerID on Orders for frequent order lookups. The USE ShopDB; statement is properly included to target the correct database. All indexes align perfectly with the usage patterns described in the scenario. Great work on analyzing the requirements and implementing the appropriate indexing strategy!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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