Query Metrics

39 Database Queries
7 Different statements
135.43 ms Query time
3 Invalid entities

Grouped Statements

Show all queries

idempiere connection

Time▼ Count Info
43.76 ms
(32.32%)
5
SELECT t0.m_product_id AS m_product_id_1, t0.ad_client_id AS ad_client_id_2, t0.ad_org_id AS ad_org_id_3, t0.name AS name_4, t0.description AS description_5, t0.sm_marca_id AS sm_marca_id_6, t0.sku AS sku_7, t0.value AS value_8, t0.m_product_category_id AS m_product_category_id_9, t0.isactive AS isactive_10, t0.issold AS issold_11, t0.sm_modelo_producto_id AS sm_modelo_producto_id_12, t0.created AS created_13, t0.createdby AS createdby_14, t0.updated AS updated_15, t0.updatedby AS updatedby_16, t0.c_taxcategory_id AS c_taxcategory_id_17, t0.c_uom_id AS c_uom_id_18, t0.issummary AS issummary_19, t0.allegation AS allegation_20, t0.sm_characteristicset_id AS sm_characteristicset_id_21, t0.m_attributeset_id AS m_attributeset_id_22, t0.comercialname AS comercialname_23, t0.m_attributesetinstance_id AS m_attributesetinstance_id_24, t0.iswebstorefeatured AS iswebstorefeatured_25, t0.discontinued AS discontinued_26, t0.sm_marca_id AS sm_marca_id_27, t0.m_product_category_id AS m_product_category_id_28, t0.sm_modelo_producto_id AS sm_modelo_producto_id_29, t0.createdby AS createdby_30, t0.sm_characteristicset_id AS sm_characteristicset_id_31, t0.m_attributeset_id AS m_attributeset_id_32, t0.m_attributesetinstance_id AS m_attributesetinstance_id_33 FROM M_Product t0 WHERE t0.sm_marca_id = ?
Parameters:
[
  1000000
]
34.89 ms
(25.76%)
2
SELECT COUNT(*)
            FROM (
                SELECT DISTINCT mp.m_product_id
                
            FROM adempiere.m_product mp
            JOIN adempiere.sm_marca sm
                ON sm.sm_marca_id = mp.sm_marca_id
            JOIN adempiere.m_product_category mpc
                ON mpc.m_product_category_id = mp.m_product_category_id
            LEFT JOIN LATERAL (
                SELECT
                    SUM(s.qtyonhand)  AS qtyonhand,
                    SUM(s.qtyordered) AS qtyordered
                FROM adempiere.m_storage s
                JOIN adempiere.m_locator l
                    ON l.m_locator_id = s.m_locator_id
                WHERE s.m_product_id = mp.m_product_id
                  AND l.m_warehouse_id = :warehouseId
            ) ms ON true
            LEFT JOIN LATERAL (
                SELECT
                    pp.pricelimit,
                    pp.price,
                    pp.pricelist,
                    pp.pricestd,
                    ve.validfrom
                FROM adempiere.m_pricelist lp
                JOIN adempiere.m_pricelist_version ve
                    ON ve.m_pricelist_version_id = (
                        SELECT ve2.m_pricelist_version_id
                        FROM adempiere.m_pricelist_version ve2
                        WHERE ve2.m_pricelist_id = lp.m_pricelist_id
                          AND ve2.isweb = 'Y'
                        ORDER BY ve2.validfrom DESC, ve2.m_pricelist_version_id DESC
                        LIMIT 1
                    )
                JOIN adempiere.m_productprice pp
                    ON pp.m_pricelist_version_id = ve.m_pricelist_version_id
                   AND pp.m_product_id = mp.m_product_id
                WHERE lp.issopricelist = 'Y'
                  AND ((sm.sm_marca_id IN (:brandPriceListBrand1000010_0, :brandPriceListBrand1000010_1, :brandPriceListBrand1000010_2, :brandPriceListBrand1000010_3, :brandPriceListBrand1000010_4) AND lp.m_pricelist_id = :brandPriceList1000010) OR (sm.sm_marca_id IN (:brandPriceListBrand1000011_0) AND lp.m_pricelist_id = :brandPriceList1000011))
                LIMIT 1
            ) pricing ON true
            LEFT JOIN LATERAL (
                SELECT d.downloadurl
                FROM adempiere.m_productdownload d
                WHERE d.m_product_id = mp.m_product_id
                  AND d.iscatalog = 'Y'
                  AND d.isonline = 'Y'
                ORDER BY d.m_productdownload_id DESC
                LIMIT 1
            ) mp2 ON true
        
                WHERE 1=1 AND COALESCE(NULLIF(UPPER(TRIM(mp.iswebstorefeatured)), ''), 'N') = 'Y'
            ) t
Parameters:
[
  "warehouseId" => 1000003
  "brandPriceListBrand1000010_0" => 1000000
  "brandPriceListBrand1000010_1" => 1000002
  "brandPriceListBrand1000010_2" => 1000003
  "brandPriceListBrand1000010_3" => 1000008
  "brandPriceListBrand1000010_4" => 1000009
  "brandPriceList1000010" => 1000010
  "brandPriceListBrand1000011_0" => 1000004
  "brandPriceList1000011" => 1000011
]
31.62 ms
(23.35%)
28
SELECT t0.m_product_category_id AS m_product_category_id_1, t0.ad_client_id AS ad_client_id_2, t0.name AS name_3, t0.isactive AS isactive_4, t0.value AS value_5, t0.m_product_category_parent_id AS m_product_category_parent_id_6 FROM m_product_category t0 WHERE t0.m_product_category_id = ?
Parameters:
[
  1000002
]
16.13 ms
(11.91%)
1
SELECT
                mp.m_product_id,
                pricing.validfrom,
                mp.value AS code,
                mp.sku,
                mp.name,
                mp.comercialname,
                mp.allegation,
                ms.qtyonhand,
                ms.qtyordered,
                (CASE WHEN mp.sm_marca_id = 1000004 THEN 1000000 ELSE sm.sm_marca_id END) AS sm_marca_id,
                mp2.downloadurl,
                pricing.pricelimit,
                pricing.price,
                pricing.pricelist,
                pricing.pricestd,
                CASE WHEN mp.sm_marca_id = 1000004 THEN 'GPLUS' ELSE sm.name END AS brand_name,
                CASE WHEN mp.sm_marca_id = 1000004 THEN 'COCINA' ELSE mpc.name END AS category_name,
                (CASE WHEN mp.sm_marca_id = 1000004 THEN 1000014 ELSE mp.m_product_category_id END) AS m_product_category_id
            
            FROM adempiere.m_product mp
            JOIN adempiere.sm_marca sm
                ON sm.sm_marca_id = mp.sm_marca_id
            JOIN adempiere.m_product_category mpc
                ON mpc.m_product_category_id = mp.m_product_category_id
            LEFT JOIN LATERAL (
                SELECT
                    SUM(s.qtyonhand)  AS qtyonhand,
                    SUM(s.qtyordered) AS qtyordered
                FROM adempiere.m_storage s
                JOIN adempiere.m_locator l
                    ON l.m_locator_id = s.m_locator_id
                WHERE s.m_product_id = mp.m_product_id
                  AND l.m_warehouse_id = :warehouseId
            ) ms ON true
            LEFT JOIN LATERAL (
                SELECT
                    pp.pricelimit,
                    pp.price,
                    pp.pricelist,
                    pp.pricestd,
                    ve.validfrom
                FROM adempiere.m_pricelist lp
                JOIN adempiere.m_pricelist_version ve
                    ON ve.m_pricelist_version_id = (
                        SELECT ve2.m_pricelist_version_id
                        FROM adempiere.m_pricelist_version ve2
                        WHERE ve2.m_pricelist_id = lp.m_pricelist_id
                          AND ve2.isweb = 'Y'
                        ORDER BY ve2.validfrom DESC, ve2.m_pricelist_version_id DESC
                        LIMIT 1
                    )
                JOIN adempiere.m_productprice pp
                    ON pp.m_pricelist_version_id = ve.m_pricelist_version_id
                   AND pp.m_product_id = mp.m_product_id
                WHERE lp.issopricelist = 'Y'
                  AND ((sm.sm_marca_id IN (:brandPriceListBrand1000010_0, :brandPriceListBrand1000010_1, :brandPriceListBrand1000010_2, :brandPriceListBrand1000010_3, :brandPriceListBrand1000010_4) AND lp.m_pricelist_id = :brandPriceList1000010) OR (sm.sm_marca_id IN (:brandPriceListBrand1000011_0) AND lp.m_pricelist_id = :brandPriceList1000011))
                LIMIT 1
            ) pricing ON true
            LEFT JOIN LATERAL (
                SELECT d.downloadurl
                FROM adempiere.m_productdownload d
                WHERE d.m_product_id = mp.m_product_id
                  AND d.iscatalog = 'Y'
                  AND d.isonline = 'Y'
                ORDER BY d.m_productdownload_id DESC
                LIMIT 1
            ) mp2 ON true
        
            WHERE 1=1 AND COALESCE(NULLIF(UPPER(TRIM(mp.iswebstorefeatured)), ''), 'N') = 'Y'
            ORDER BY mp.comercialname ASC
            LIMIT :length OFFSET :start
Parameters:
[
  "warehouseId" => 1000003
  "brandPriceListBrand1000010_0" => 1000000
  "brandPriceListBrand1000010_1" => 1000002
  "brandPriceListBrand1000010_2" => 1000003
  "brandPriceListBrand1000010_3" => 1000008
  "brandPriceListBrand1000010_4" => 1000009
  "brandPriceList1000010" => 1000010
  "brandPriceListBrand1000011_0" => 1000004
  "brandPriceList1000011" => 1000011
  "length" => 1000
  "start" => 0
]
5.65 ms
(4.17%)
1
SELECT
    pel.m_product_id
    --, age(min(pel.created)) AS creado_minimo
FROM sm_precio_estimadoline pel
JOIN sm_precio_estimado spe
    ON spe.sm_precio_estimado_id = pel.sm_precio_estimado_id
WHERE
    pel.listo = 'Y' 
    AND spe.docstatus = 'Y'
    --AND pel.m_product_id = :m_product_id
GROUP BY pel.m_product_id
HAVING min(pel.created) > ?
ORDER BY pel.m_product_id;
Parameters:
[
  "2025-10-22 05:16:52"
]
1.79 ms
(1.32%)
1
SELECT sm_m_promotion_id as id, "name", description, m_pricelist_id as listaPrecioId, sm_marca_id, startdate as fechaInicio, enddate as fechaFin, qty, qtylimit, qtymax, qtymaxseller, (SELECT COALESCE(SUM((CASE WHEN qtybook = 0 THEN 1 ELSE qtybook END) * amt), 0) FROM sm_m_promotionprecondition precondition WHERE precondition.sm_m_promotion_id = sm_m_promotion.sm_m_promotion_id) AS "Amt" FROM sm_m_promotion WHERE isactive = 'Y' AND NOW() BETWEEN "startdate" AND ("enddate"::date + interval '1 day' - interval '1 second')
Parameters:
[]
1.58 ms
(1.17%)
1
SELECT t0.sm_marca_id AS sm_marca_id_1, t0.sm_marca_uu AS sm_marca_uu_2, t0.ad_client_id AS ad_client_id_3, t0.ad_org_id AS ad_org_id_4, t0.name AS name_5, t0.isactive AS isactive_6, t0.sm_bp_item_id AS sm_bp_item_id_7, t0.issold AS issold_8, t0.IsWeb AS isweb_9 FROM sm_marca t0 WHERE t0.IsWeb = ?
Parameters:
[
  "Y"
]

Database Connections

Name Service
order doctrine.dbal.order_connection
idempiere doctrine.dbal.idempiere_connection

Entity Managers

Name Service
order doctrine.orm.order_entity_manager
idempiere doctrine.orm.idempiere_entity_manager

Second Level Cache

Second Level Cache is not enabled.

Entities Mapping

order entity manager

No loaded entities.

idempiere entity manager

Class Mapping errors
App\Entity\Idempiere\SmMarca No errors.
App\Entity\Idempiere\MProduct No errors.
App\Entity\Idempiere\SmCategoriaProductoMarca No errors.
App\Entity\Idempiere\SmRelatedbrand No errors.
App\Entity\Idempiere\MProductCategory No errors.
App\Entity\Idempiere\SmModeloProducto No errors.
App\Entity\Idempiere\AdUser
  • The field App\Entity\Idempiere\AdUser#salesRep is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity App\Entity\Idempiere\SmSalesRep#ad_user does not contain the required 'inversedBy="salesRep"' attribute.
App\Entity\Idempiere\SmCharacteristicset No errors.
App\Entity\Idempiere\MAttributeset No errors.
App\Entity\Idempiere\MAttributesetinstance No errors.
App\Entity\Idempiere\MProductdownload No errors.
App\Entity\Idempiere\MProductprice No errors.
App\Entity\Idempiere\SmMPromotionprecondition No errors.
App\Entity\Idempiere\SmUserProductaccess No errors.
App\Entity\Idempiere\SmFichaTecnica No errors.
App\Entity\Idempiere\SmPrecioEstimadoline No errors.
App\Entity\Idempiere\MaterialManagement\StorageOnHand
  • The association App\Entity\Idempiere\MaterialManagement\StorageOnHand#locator refers to the inverse side field App\Entity\Idempiere\MaterialManagement\Locator#storagesOnHand which does not exist.
App\Entity\Idempiere\MaterialManagement\Reservation
  • The association App\Entity\Idempiere\MaterialManagement\Reservation#warehouse refers to the inverse side field App\Entity\Idempiere\MWarehouse#warehouseList which does not exist.