What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello! In spryker package `spy_price_product_store` there is an index of `spy_price_product_store-i
Hello!
In spryker package spy_price_product_store
there is an index of spy_price_product_store-index-fk_pr_pro-fk_cur-fk_st
, which adds indexes to every column. This is causing issues for us to insert product prices. What would be the solution?
Comments
-
the index are usually named
0 -
you might be able to override them on project level
0 -
Will it also remove it?
0 -
What exactly is your problem with the index?
0 -
As usually these definitions are merged.
0 -
We have 1.5 mil. rows in spy_price_product_store, to do an insert for one row, due to this index, it takes 7 minutes
0 -
No, it’s not possible to remove indices via schema.xml
0 -
So Spryker fucked up big time.
0 -
🤔
0 -
i don’t think so
0 -
So, what would be the solution then?
0 -
currently checking something
0 -
As I quote:
>
No, it’s not possible to remove indices via schema.xml
0 -
removing the index can have impact on read-time performance
0 -
Really? (you think I’m stupid?) What’s the point of read if you can’t even insert.
0 -
yes, right.. the index exist also on my project..
but the table isspy_price_product_store
notspy_price_product
.But it has no bad insert time problem on our project (we don't use the standard propel import for price).
This index has no sense!
0 -
Could you give a little more context to your issue?
When does this happen, during a mass import of prices or when saving a single one through Zed UI?
What database do you use?Regarding the remove possibility in schema.xml, this is not really an issue introduced by Spryker, but the result of how Propel works with auto migrations.
0 -
the index is here defined -> vendor/spryker/price-product/src/Spryker/Zed/PriceProduct/Persistence/Propel/Schema/spy_price_product.schema.xml:64
0 -
i agree with @UL6DGRULR, we would need a bit more context to help find a suitable solution for your scenario
0 -
ok, assuming we talk about mass importing here
0 -
naive approaches:
0 -
most database systems allow you to temporarily suspend index inserting
0 -
another suggestion is to use bulk writing (there are examples in spryker-shop/suite)
0 -
iirc, since the indexes are named, you can also override the index definition
0 -
how did you determine that the index is the bottleneck?
0 -
We use bulk writing with 20 stores and 1 product.
0 -
It has 20 rows to insert. But we tested it with 1 row. And it took 7 minutes.
0 -
Then as @UJN2JRU4F already suggested, deactivate the index check, import all prices, reactivate it. This will build the index only once and not for every insert.
MySQL: https://support.tigertech.net/mysql-large-inserts
Postgres: https://fle.github.io/temporarily-disable-all-indexes-of-a-postgresql-table.html0 -
It’s not mysql. It’s postgres…. (sorry, misread message)
0 -
there are links for both in the above
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random