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

Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
edited October 2019 in Help

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?

Welcome!

It looks like you're new here. Sign in or register to get started.
ยซ13

Comments

  • the index are usually named

  • you might be able to override them on project level

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Will it also remove it?

  • Lead Spryker Solution Architect / Technical Director Posts: 690 ๐Ÿช - Explorer

    What exactly is your problem with the index?

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
    edited October 2019

    As usually these definitions are merged.

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    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

  • Lead Spryker Solution Architect / Technical Director Posts: 690 ๐Ÿช - Explorer

    No, itโ€™s not possible to remove indices via schema.xml

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
    edited October 2019

    So Spryker fucked up big time.

  • ๐Ÿค”

  • i donโ€™t think so

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    So, what would be the solution then?

  • currently checking something

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    As I quote:

    No, itโ€™s not possible to remove indices via schema.xml

  • removing the index can have impact on read-time performance

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Really? (you think Iโ€™m stupid?) Whatโ€™s the point of read if you canโ€™t even insert.

  • Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    yes, right.. the index exist also on my project..
    but the table is spy_price_product_store not spy_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!

  • Lead Spryker Solution Architect / Technical Director Posts: 690 ๐Ÿช - Explorer

    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.

  • Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    the index is here defined -> vendor/spryker/price-product/src/Spryker/Zed/PriceProduct/Persistence/Propel/Schema/spy_price_product.schema.xml:64

  • i agree with @UL6DGRULR, we would need a bit more context to help find a suitable solution for your scenario

  • ok, assuming we talk about mass importing here

  • naive approaches:

  • most database systems allow you to temporarily suspend index inserting

  • another suggestion is to use bulk writing (there are examples in spryker-shop/suite)

  • Unknown
    edited October 2019

    iirc, since the indexes are named, you can also override the index definition

  • how did you determine that the index is the bottleneck?

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    We use bulk writing with 20 stores and 1 product.

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    It has 20 rows to insert. But we tested it with 1 row. And it took 7 minutes.

  • Lead Spryker Solution Architect / Technical Director Posts: 690 ๐Ÿช - Explorer

    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.html

  • Posts: 128 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
    edited October 2019

    Itโ€™s not mysql. Itโ€™s postgresโ€ฆ. (sorry, misread message)

  • Unknown
    edited October 2019

    there are links for both in the above

Welcome!

It looks like you're new here. Sign in or register to get started.