Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize taxonomy <> collection queries #376

Merged
merged 17 commits into from
Nov 13, 2024

Conversation

TheBnl
Copy link
Contributor

@TheBnl TheBnl commented Nov 9, 2024

Working on a draft to fix issue #373

The current implementation does not yet pass the tests due to not being fully db driver independent.
The test fails because JSON_QUOTE seems to behave different in sqllite than mysql.
The JSON_QUOTE should probably not be hard coded here as well because we can't assume the db driver that is in use.

Closes #373

Bram de Leeuw added 2 commits November 9, 2024 14:28
@TheBnl TheBnl mentioned this pull request Nov 9, 2024
@ryanmitchell
Copy link
Contributor

ryanmitchell commented Nov 11, 2024

@TheBnl let's move the conversation over here. I've modified the approach and have tests working on SQLite and it works fine on MySQL from my own testing.

Do you have access to sqlserver or postgres to check this on? It also needs some test coverage if you could work on that.

@ryanmitchell ryanmitchell changed the title DRAFT: Optimize taxonomy queries Optimize taxonomy <> collection queries Nov 11, 2024
@TheBnl
Copy link
Contributor Author

TheBnl commented Nov 11, 2024

@TheBnl let's move the conversation over here. I've modified the approach and have tests working on SQLite and it works fine on MySQL from my own testing.

Do you have access to sqlserver or postgres to check this on? It also needs some test coverage if you could work on that.

Awesome! Will test on postgress, haven't came by to installing sqlserver yet. Will check and look into adding postgress/sqlserver to the github test workflow. 👍

@TheBnl
Copy link
Contributor Author

TheBnl commented Nov 12, 2024

Tested with postgres and there we do need wrap it so the value will be handled as json: to_jsonb({$wrappedColumn}::text)

Working on the test coverage in a different branch, also to test sqlserver, as it is quite a bit of work of settings things up right.

@ryanmitchell
Copy link
Contributor

Sorry I didn't mean we need to set up different testing environments for each database engine - I just meant we needed a test in the suite to cover this new behaviour.

@TheBnl
Copy link
Contributor Author

TheBnl commented Nov 13, 2024

Ah haha well that makes things quite simpler. I've added a test where the entries driver is set to 'file' so both the join and map gets tested.

@ryanmitchell ryanmitchell marked this pull request as ready for review November 13, 2024 09:30
@ryanmitchell ryanmitchell merged commit 4440a8b into statamic:master Nov 13, 2024
11 checks passed
@ryanmitchell
Copy link
Contributor

Thanks for your work on this - really appreciate it.

@TheBnl
Copy link
Contributor Author

TheBnl commented Nov 13, 2024

Awesome thanks for merging!

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.

Optimize taxonomy queries.
2 participants