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

New segment operators: "Starts with" and "Ends with" #8076

Closed
iMarkus opened this issue Jun 9, 2015 · 10 comments
Closed

New segment operators: "Starts with" and "Ends with" #8076

iMarkus opened this issue Jun 9, 2015 · 10 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@iMarkus
Copy link
Contributor

iMarkus commented Jun 9, 2015

When creating segments it is only possible to use “Is”, “Is not”, “Contains”, “Does not contain” on non-numeric values. Regarding MySQL Performance, it would make sense to implement “Starts with” and “Ends with” for segment metric definition.

@mattab
Copy link
Member

mattab commented Jun 10, 2015

Thanks @iMarkus for the suggestion.

@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Jun 10, 2015
@mattab mattab added this to the Mid term milestone Jun 10, 2015
@iMarkus
Copy link
Contributor Author

iMarkus commented Jun 10, 2015

I had a quick look at the code, should not be that hard to implement :)

looking forward

@mattab mattab removed this from the Mid term milestone Jun 10, 2015
@tsteur
Copy link
Member

tsteur commented Jun 12, 2015

I had a quick look at the code, should not be that hard to implement :)

We always appreciate pull requests :)

@iMarkus
Copy link
Contributor Author

iMarkus commented Jun 12, 2015

:)

@mattab
Copy link
Member

mattab commented Jul 7, 2015

To implement "starts with" and "ends with" we would still use the Mysql % character so I don't think it would improve performance.

@iMarkus what is the main reason you need "Starts with" and "ends with" - you write "performance" - do you have performance challenge with using "Contains"?

@iMarkus
Copy link
Contributor Author

iMarkus commented Jul 7, 2015

Hi Mattab,
I thought that using "searchstring%" and "%searchstring" would be faster than "%searchstring%".

Yes we are currently facing some performance issues on real time segments when users define their segments using "Contains" on page urls. Therefore this suggestion came up.

Regards,
Markus

@mattab
Copy link
Member

mattab commented Jul 7, 2015

It's true that search% may use an index, but in Piwik DB, the field log_action.name is not indexed so index won't be used (it does not exist). "Starts with" and "ends with" wouldn't speed up the query.

@iMarkus
Copy link
Contributor Author

iMarkus commented Jul 7, 2015

Alright. Thanks Matthieu for the detailed explanation. In this case it is unnecessary to implement such feature.

Best regards

@mattab mattab closed this as completed Jul 7, 2015
@mattab mattab added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Jul 7, 2015
@mattab
Copy link
Member

mattab commented Jul 7, 2015

@iMarkus Thanks for additional information too. it's always positive outcome when features don't need to be implemented :-)

@tsteur tsteur reopened this Nov 17, 2015
@tsteur
Copy link
Member

tsteur commented Nov 17, 2015

It looks like we will need to implement it after all as it is needed for segmentation of actionUrls in #9129 .

We'll introduce two new operators very likely: =^ for starts with and =$ for ends with

We need these operators to implement #9224

@tsteur tsteur removed the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Nov 17, 2015
@tsteur tsteur added this to the 2.15.1 milestone Nov 17, 2015
@tsteur tsteur self-assigned this Nov 17, 2015
@mattab mattab changed the title Performance: Add "Starts with" and "Ends with" to Segment metric definition New segment operators: "Starts with" and "Ends with" Nov 17, 2015
tsteur added a commit that referenced this issue Nov 17, 2015
tsteur added a commit that referenced this issue Nov 18, 2015
tsteur added a commit that referenced this issue Nov 19, 2015
@mattab mattab added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Jan 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants