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

Mysql leads table, too many keys specified max 64 keys allowed #4465

Closed
FerRubioMorales opened this issue Jul 19, 2017 · 13 comments
Closed

Mysql leads table, too many keys specified max 64 keys allowed #4465

FerRubioMorales opened this issue Jul 19, 2017 · 13 comments

Comments

@FerRubioMorales
Copy link

What type of report is this:

Q A
Bug report? Yes
Feature request?
Enhancement?

Description:

This bug does not let you perform write actions over leads table. When custom field property it's created the system also creates and index in this table. For solve you have to recompile MySQL:

./configure --prefix=/usr/local/mysql --with-charset=cp1251 --enable-thread-safe-client --with-max-indexes=256

If a bug:

Q A
Mautic version 2.9.0
PHP version 7.1

Steps to reproduce:

  1. Create new custom field properties (each custom field property ads an index to the lead table, when max keys are 64 and this is not being controlled)
  2. Try tu run doctrine:schema:update
  3. You will have an error that says: "too many keys specified max 64 keys allowed". This produce a partial migration and lead tables does not contains all the columns.

Log errors:

[Doctrine\DBAL\Exception\DriverException]
An exception occurred while executing 'CREATE INDEX instagram_search ON leads (instagram)':
SQLSTATE[42000]: Syntax error or access violation: 1069 Too many keys specified; max 64 keys allowed

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1069 Too many keys specified; max 64 keys allowed

[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1069 Too many keys specified; max 64 keys allowed

@escopecz
Copy link
Sponsor Member

Thanks for the report! I'll close it in favour of #4372

@pjeby
Copy link
Contributor

pjeby commented Jul 19, 2017

How is this related to #4372? That issue doesn't say anything about indexes, only column size. Is it to add an option for whether the field should be indexed or not?

@escopecz
Copy link
Sponsor Member

Yes, that is the idea. Give user option to configure the column size and whether the column should have index. Please comment there with the index limit. I still think these 2 options could be done in one PR.

@moskoweb
Copy link
Contributor

moskoweb commented Apr 6, 2018

How to solve this problem?

It's stopping my campaigns from run.

@FerRubioMorales
Copy link
Author

FerRubioMorales commented Apr 7, 2018 via email

@escopecz
Copy link
Sponsor Member

escopecz commented Apr 9, 2018

A quick fix could be to remove indexes from some custom fields that you think Mautic does not use to search or join by. For example those that aren't used in segment filters. You'd have to do that in your database directly. Use PhpMyAdmin or Adminer for easier database manipulation. Let us know if this worked for you please.

@FerRubioMorales
Copy link
Author

FerRubioMorales commented Apr 9, 2018 via email

@escopecz
Copy link
Sponsor Member

escopecz commented Apr 9, 2018

Nope, migrations do not add the indexes back. But every time you create a custom field and maybe during update the index will be created.

@moskoweb
Copy link
Contributor

So you have no solution for that yet? Why the problem is giving in a custom field I created in 2.12.11.

@FerRubioMorales
Copy link
Author

FerRubioMorales commented Apr 10, 2018 via email

@moskoweb
Copy link
Contributor

The ideal would be to have a solution, the alternative may work temporarily, but with the growth of the tool, how does it work?

@YosuCadilla
Copy link

Might this be helpful?
https://www.safaribooksonline.com/blog/2012/11/06/avoiding-too-many-keys-in-mysql/

@starshunter88
Copy link

+1 I am also encountering this issue

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

No branches or pull requests

6 participants