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

Can we make it possible to store tags in seperate table? #665

Open
iwasherefirst2 opened this issue Nov 1, 2021 · 3 comments
Open

Can we make it possible to store tags in seperate table? #665

iwasherefirst2 opened this issue Nov 1, 2021 · 3 comments
Assignees
Labels
enhancement An improvement or new feature

Comments

@iwasherefirst2
Copy link

iwasherefirst2 commented Nov 1, 2021

| Bug? | no
| New Feature? |yes
| Framework | Laravel
| Framework version | 8.12
| Package version | 12.0
| PHP version | ^8.0

Actual Behaviour

Tags are stored in tags column of Audit Model

Expected Behaviour

I would like to be able to store tags in a seperate table, because when multiple tags are inside "tags" column filtering using SQL becomes very slow since one cannot use indexing.

Possible Solutions

Instead of directly calling create on the implementation at

return call_user_func([$implementation, 'create'], $model->toAudit());
one could use a UserCreate service that is called (just as we have the resolver services). In this service class, only the create method is called.

Thus the UserCreate service could be overwritten in the configs (just as the resolvers). People could then choose freely if they would like to store the tags in a different table inside their custom UserCreate service.

If you agree with this small change, I would like to create the MR.

@MortenDHansen MortenDHansen self-assigned this Jan 27, 2022
@MortenDHansen MortenDHansen added the enhancement An improvement or new feature label Jan 27, 2022
@MortenDHansen
Copy link
Contributor

It's a pretty good idea. I imagine it would make for a significant improvement when querying/filtering by tags on very large table.

@idoomguy
Copy link

Is there any update on this matter? We have a sizable project, and the audit table contains millions of records. Therefore, searching using LIKE is an extremely time-consuming task.

@MortenDHansen
Copy link
Contributor

Is there any update on this matter? We have a sizable project, and the audit table contains millions of records. Therefore, searching using LIKE is an extremely time-consuming task.

Yes. It will happen. But I can't put a date on it yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement or new feature
Projects
None yet
Development

No branches or pull requests

3 participants