DB Index Error

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

DB Index Error

Post by jramirezgranada » 12 Sep 2018, 19:43

I'm seeding some data in mshop_product_property table and some values are very long and I'm getting this error Program limit exceeded: 7 ERROR: index row requires 13632 bytes, maximum size is 8191

My questions are ?
1. Can I drop the index ?
2. What happens if I drop it ?
3. Is there a way to fix that ?

Thanks
--
Jorge A Ramirez
System Engineer
PHP Developer

User avatar
aimeos
Administrator
Posts: 7858
Joined: 01 Jan 1970, 00:00

Re: DB Index Error

Post by aimeos » 13 Sep 2018, 19:20

Product properties are not meant for large amounts of data (usually not more than a few bytes). If you need to store long texts, please use the mshop_text table. If you delete the index, performance will drop severely.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

Re: DB Index Error

Post by jramirezgranada » 17 Sep 2018, 17:06

aimeos wrote:Product properties are not meant for large amounts of data (usually not more than a few bytes). If you need to store long texts, please use the mshop_text table. If you delete the index, performance will drop severely.
I did it as you said in the mshop_text_table, but i got the same error about index, this is a part of the error:

Code: Select all

SQLSTATE[54000]: Program limit exceeded: 7 ERROR:  index row requires 16488 bytes, maximum size is 8191 (SQL: insert into "mshop_text" ("siteid", "typeid", "label", "content", "langid", "domain", "status", "mtime", "ctime", "editor") values (1, 44, Tab one content, <p class="TOCtitle">Chapter 1<br /> Introduction to the Public Domain</p>
<p class="TOCheading1">What Is the Public Domainen................................................................................. 4</p>
<p class="TOCheading2">Copyright and the Public Domain................................................................ 4</p>
<p class="TOCheading2">What Is in the Public Domainproduct...................................................................... 5</p>
<p class="TOCheading2">How Can You Use the Public Domain1....................................................... 5</p>
<p class="TOCheading2">Why Have a Public Domain2018-09-17 09:37:51.......................................................................... 6</p>
<p class="TOCheading2">How Do You Know If a Work Is in the Public Domain2018-09-17 09:37:51........................ 9</p>
<p class="TOCheading2">How Do You Find Public Domain Materials......................................... 10</p>
<p class="TOCheading2">Are Public Domain Works Always Free?................................................ 10</p>
<p class="TOCheading1">Dealing With Public Domain Gray Areas...................................................... 11</p>
<p class="TOCheading2">What Is the Likelihood of Discovery?....................................................... 12</p>
<p class="TOCheading2">How Valuable Is the Material?................................................................... 13</p>
<p class="TOCheading1">What If Someone Challenges Your Public Domain Claim?..................... 14</p>
<p class="TOCheading2">Handling the Claim Yourself....................................................................... 14</p>
<p class="TOCheading2">Hiring a Lawyer............................................................................................... 15</p>
<p class="TOCheading1">Documenting Your Use of Public Domain Materials................................. 15</p>
that content has a lot of more text,

Any idea to help me?

Thanks
--
Jorge A Ramirez
System Engineer
PHP Developer

User avatar
aimeos
Administrator
Posts: 7858
Joined: 01 Jan 1970, 00:00

Re: DB Index Error

Post by aimeos » 18 Sep 2018, 12:06

There's no index on the content so the problem might be (contrary to the error message) that column is simply not long enough. The default size is 64kb. Does your text you want to insert has more than that?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

Re: DB Index Error

Post by jramirezgranada » 18 Sep 2018, 12:12

Yes, content could have more than 64kb,hiw can I change that size?

Thanks
--
Jorge A Ramirez
System Engineer
PHP Developer

User avatar
aimeos
Administrator
Posts: 7858
Joined: 01 Jan 1970, 00:00

Re: DB Index Error

Post by aimeos » 18 Sep 2018, 12:51

This commit in dev-master might fix the problem:
https://github.com/aimeos/aimeos-core/c ... 29a34fb60d

Can you check? Beware: Doctrine doesn't seem to update the size of text columns if they already exist!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

Re: DB Index Error

Post by jramirezgranada » 18 Sep 2018, 19:06

aimeos wrote:There's no index on the content so the problem might be (contrary to the error message) that column is simply not long enough. The default size is 64kb. Does your text you want to insert has more than that?
Your commit doesn't work, also you said that there isn't index with content, but there is a compound index named idx_mstex_sid_dom_cont https://ibb.co/iO0juz that index is getting the error I mentioned you.

Thanks
--
Jorge A Ramirez
System Engineer
PHP Developer

jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

Re: DB Index Error

Post by jramirezgranada » 19 Sep 2018, 18:45

Any idea on this ??
--
Jorge A Ramirez
System Engineer
PHP Developer

User avatar
aimeos
Administrator
Posts: 7858
Joined: 01 Jan 1970, 00:00

Re: DB Index Error

Post by aimeos » 21 Sep 2018, 12:23

Yes, there's actually an index and did you try to remove that index and add it again using this statement?

Code: Select all

CREATE INDEX "idx_mstex_sid_dom_cont" ON "mshop_text" ("siteid", "domain", left("content", 255) );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply