PHPUnit 11.5.56 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.5
Configuration: /Users/gentianbeqiri/StudioProjects/pos_system/apps/api/phpunit.xml

.............................................................   61 / 1268 (  4%)
.............................................................  122 / 1268 (  9%)
.............................................................  183 / 1268 ( 14%)
.............................................................  244 / 1268 ( 19%)
.............................................................  305 / 1268 ( 24%)
.............................................................  366 / 1268 ( 28%)
.............................................................  427 / 1268 ( 33%)
................................................S..S.........  488 / 1268 ( 38%)
.............................................................  549 / 1268 ( 43%)
.................S...........................................  610 / 1268 ( 48%)
.............................................................  671 / 1268 ( 52%)
.............................................................  732 / 1268 ( 57%)
.............................................................  793 / 1268 ( 62%)
......................................................S......  854 / 1268 ( 67%)
...........
{
    "investigation": "BusinessAdvisorQueryInvestigation",
    "database": "sqlite_in_memory",
    "disclaimer": "Not production performance. Fixture setup queries excluded from analyze counts.",
    "scaled_synthetic": {
        "10": {
            "fixture_setup_queries": 899,
            "profile": {
                "products_analyzed": 10,
                "strategies_discovered": 20,
                "strategies_evaluated": 40,
                "cross_product_evaluated": 30,
                "comparison_incomplete": false,
                "queries": {
                    "market_health_isolated": 88,
                    "financial_optimization_with_precomputed_health": 700,
                    "business_advisor_full_orchestration": 789,
                    "business_advisor_overhead_estimate": 1
                },
                "unique_fingerprints_business_advisor": 52,
                "top_fingerprints_business_advisor": {
                    "select * from \"businesses\" where \"businesses\".\"id\" = ? and \"businesses\".\"deleted_at\" is null limit ?": 62,
                    "select distinct \"l\".\"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                    "select sum(\"l\".\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                    "select sum(\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"product_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?)": 60,
                    "select * from \"products\" where \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 50,
                    "select * from \"retail_intelligence_product_basket_stats\" where \"business_id\" = ? and \"product_id\" = ? and \"location_scope\" = ? and strftime(?, \"window_from\") = cast(? as text) and strftime(?, \"window_to\") = cast(? as text) limit ?": 40,
                    "select count(distinct \"l\".\"basket_fact_id\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text) and l.net_quantity >= ?": 40,
                    "select \"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"f\" where \"f\".\"business_id\" = ? and \"f\".\"product_id\" = ? and strftime(?, \"f\".\"business_day\") >= cast(? as text) and strftime(?, \"f\".\"business_day\") <= cast(? as text)": 40,
                    "select \"product_id\", COUNT(DISTINCT basket_fact_id) as co_basket_count from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?) and \"product_id\" != ? group by \"product_id\" order by COUNT(DISTINCT basket_fact_id) desc limit ?": 40,
                    "select * from \"promotions\" where \"business_id\" = ? and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 30,
                    "select * from \"retail_intelligence_product_pair_stats\" where \"business_id\" = ? and \"location_scope\" = ? and strftime(?, \"window_from\") = cast(? as text) and strftime(?, \"window_to\") = cast(? as text) and ((\"product_a_id\" = ? and \"product_b_id\" = ?) or (\"product_a_id\" = ? and \"product_b_id\" = ?)) limit ?": 30,
                    "select * from \"competitor_ml_model_versions\" where \"business_id\" = ? and \"status\" = ? and \"scope\" = ? limit ?": 27,
                    "select * from \"retail_intelligence_basket_facts\" where \"id\" in (?, ?, ?, ?, ?)": 25,
                    "select * from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?)": 25,
                    "select * from \"promotions\" where \"business_id\" is null and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 20
                },
                "table_category_hits_business_advisor": {
                    "products": 97,
                    "stock_balances": 3,
                    "purchase_cost_history": 2,
                    "basket_product_facts": 379,
                    "basket_facts": 25,
                    "sales": 0,
                    "sale_lines": 0,
                    "competitor": 59,
                    "demand_ml": 0,
                    "business_location": 62,
                    "other": 162
                },
                "purchase_cost_history_query_hits_in_top_fingerprints": 0,
                "execution_ms": 128,
                "peak_memory_bytes": 330301440
            }
        },
        "20": {
            "fixture_setup_queries": 1020,
            "profile": {
                "products_analyzed": 20,
                "strategies_discovered": 40,
                "strategies_evaluated": 50,
                "cross_product_evaluated": 30,
                "comparison_incomplete": false,
                "queries": {
                    "market_health_isolated": 158,
                    "financial_optimization_with_precomputed_health": 910,
                    "business_advisor_full_orchestration": 1069,
                    "business_advisor_overhead_estimate": 1
                },
                "unique_fingerprints_business_advisor": 52,
                "top_fingerprints_business_advisor": {
                    "select * from \"businesses\" where \"businesses\".\"id\" = ? and \"businesses\".\"deleted_at\" is null limit ?": 92,
                    "select * from \"products\" where \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 70,
                    "select * from \"promotions\" where \"business_id\" = ? and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 60,
                    "select distinct \"l\".\"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                    "select sum(\"l\".\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                    "select sum(\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"product_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?)": 60,
                    "select * from \"retail_intelligence_product_basket_stats\" where \"business_id\" = ? and \"product_id\" = ? and \"location_scope\" = ? and strftime(?, \"window_from\") = cast(? as text) and strftime(?, \"window_to\") = cast(? as text) limit ?": 50,
                    "select count(distinct \"l\".\"basket_fact_id\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text) and l.net_quantity >= ?": 50,
                    "select \"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"f\" where \"f\".\"business_id\" = ? and \"f\".\"product_id\" = ? and strftime(?, \"f\".\"business_day\") >= cast(? as text) and strftime(?, \"f\".\"business_day\") <= cast(? as text)": 50,
                    "select \"product_id\", COUNT(DISTINCT basket_fact_id) as co_basket_count from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?) and \"product_id\" != ? group by \"product_id\" order by COUNT(DISTINCT basket_fact_id) desc limit ?": 50,
                    "select * from \"promotions\" where \"business_id\" is null and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 40,
                    "select * from \"products\" where \"business_id\" = ? and \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 40,
                    "select * from \"competitor_product_mappings\" where \"business_id\" = ? and \"product_id\" = ? and \"match_status\" = ?": 40,
                    "select * from \"competitor_ml_model_versions\" where \"business_id\" = ? and \"status\" = ? and \"scope\" = ? limit ?": 37,
                    "select * from \"retail_intelligence_basket_facts\" where \"id\" in (?, ?, ?, ?, ?)": 35
                },
                "table_category_hits_business_advisor": {
                    "products": 157,
                    "stock_balances": 3,
                    "purchase_cost_history": 2,
                    "basket_product_facts": 439,
                    "basket_facts": 35,
                    "sales": 0,
                    "sale_lines": 0,
                    "competitor": 99,
                    "demand_ml": 0,
                    "business_location": 92,
                    "other": 242
                },
                "purchase_cost_history_query_hits_in_top_fingerprints": 0,
                "execution_ms": 233,
                "peak_memory_bytes": 332398592
            }
        },
        "40": {
            "fixture_setup_queries": 2250,
            "profile": {
                "products_analyzed": 25,
                "strategies_discovered": 50,
                "strategies_evaluated": 55,
                "cross_product_evaluated": 30,
                "comparison_incomplete": false,
                "queries": {
                    "market_health_isolated": 192,
                    "financial_optimization_with_precomputed_health": 1014,
                    "business_advisor_full_orchestration": 1207,
                    "business_advisor_overhead_estimate": 1
                },
                "unique_fingerprints_business_advisor": 51,
                "top_fingerprints_business_advisor": {
                    "select * from \"businesses\" where \"businesses\".\"id\" = ? and \"businesses\".\"deleted_at\" is null limit ?": 107,
                    "select * from \"products\" where \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 80,
                    "select * from \"promotions\" where \"business_id\" = ? and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 75,
                    "select distinct \"l\".\"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                    "select sum(\"l\".\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                    "select sum(\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"product_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?)": 60,
                    "select * from \"retail_intelligence_product_basket_stats\" where \"business_id\" = ? and \"product_id\" = ? and \"location_scope\" = ? and strftime(?, \"window_from\") = cast(? as text) and strftime(?, \"window_to\") = cast(? as text) limit ?": 55,
                    "select count(distinct \"l\".\"basket_fact_id\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text) and l.net_quantity >= ?": 55,
                    "select \"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"f\" where \"f\".\"business_id\" = ? and \"f\".\"product_id\" = ? and strftime(?, \"f\".\"business_day\") >= cast(? as text) and strftime(?, \"f\".\"business_day\") <= cast(? as text)": 55,
                    "select \"product_id\", COUNT(DISTINCT basket_fact_id) as co_basket_count from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?) and \"product_id\" != ? group by \"product_id\" order by COUNT(DISTINCT basket_fact_id) desc limit ?": 55,
                    "select * from \"promotions\" where \"business_id\" is null and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 50,
                    "select * from \"products\" where \"business_id\" = ? and \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 50,
                    "select * from \"competitor_product_mappings\" where \"business_id\" = ? and \"product_id\" = ? and \"match_status\" = ?": 50,
                    "select * from \"competitor_ml_model_versions\" where \"business_id\" = ? and \"status\" = ? and \"scope\" = ? limit ?": 42,
                    "select * from \"retail_intelligence_basket_facts\" where \"id\" in (?, ?, ?, ?, ?)": 40
                },
                "table_category_hits_business_advisor": {
                    "products": 185,
                    "stock_balances": 3,
                    "purchase_cost_history": 2,
                    "basket_product_facts": 469,
                    "basket_facts": 40,
                    "sales": 0,
                    "sale_lines": 0,
                    "competitor": 119,
                    "demand_ml": 0,
                    "business_location": 107,
                    "other": 282
                },
                "purchase_cost_history_query_hits_in_top_fingerprints": 0,
                "execution_ms": 384,
                "peak_memory_bytes": 342884352
            }
        }
    },
    "recommendation_fixture": {
        "fixture_setup_queries": 252,
        "http_analyze_queries": 213,
        "http_top_fingerprints": {
            "select * from \"permissions\" where (\"key\" = ?) limit ?": 68,
            "select * from \"businesses\" where \"businesses\".\"id\" = ? and \"businesses\".\"deleted_at\" is null limit ?": 10,
            "select * from \"roles\" where (\"business_id\" is null and \"key\" = ?) limit ?": 9,
            "select * from \"role_permission\" where \"role_permission\".\"role_id\" = ?": 9,
            "select * from \"promotions\" where \"business_id\" = ? and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 6,
            "select * from \"products\" where \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 6,
            "select * from \"promotions\" where \"business_id\" is null and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 4,
            "select * from \"competitor_ml_model_versions\" where \"business_id\" = ? and \"status\" = ? and \"scope\" = ? limit ?": 4,
            "select COUNT(*) as prediction_rows, COUNT(DISTINCT product_id) as products_forecasted, MIN(target_day) as window_from, MAX(target_day) as window_to, MAX(horizon_days) as max_horizon, MAX(updated_at) as generated_at from \"competitor_ml_predictions\" where \"business_id\" = ? and \"model_version_id\" = ? and \"location_id\" is null and \"target\" = ? limit ?": 4,
            "select distinct \"target_day\", \"horizon_days\" from \"competitor_ml_predictions\" where \"business_id\" = ? and \"model_version_id\" = ? and \"location_id\" is null and \"target\" = ?": 4,
            "select * from \"products\" where \"business_id\" = ? and \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 4,
            "select * from \"competitor_product_mappings\" where \"business_id\" = ? and \"product_id\" = ? and \"match_status\" = ?": 4,
            "select \"id\", \"name\", \"location_id\" from \"warehouses\" where \"business_id\" = ? and \"id\" in (?) and \"warehouses\".\"deleted_at\" is null": 3,
            "select \"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"f\" where \"f\".\"business_id\" = ? and \"f\".\"product_id\" = ? and strftime(?, \"f\".\"business_day\") >= cast(? as text) and strftime(?, \"f\".\"business_day\") <= cast(? as text)": 3,
            "select count(*) as aggregate from \"retail_learning_canonical_records\" where \"business_id\" = ? and \"observation_at\" between ? and ? and \"quality_status\" = ?": 3
        }
    }
}
...........
{
    "financial_optimization_perf": {
        "products": 8,
        "strategies_evaluated": 38,
        "queries": 714,
        "execution_ms": 90,
        "reported_execution_ms": 89
    }
}
.........................
[Phase11I] business-advisor fixture: p50=13.0ms p95=18.1ms queries=555
.........
{
    "phase": "11K-after",
    "benchmark": {
        "10": {
            "products_analyzed": 10,
            "strategies_evaluated": 40,
            "cross_product_evaluated": 40,
            "sql_count": 796,
            "unique_fingerprints": 52,
            "top_fingerprints": {
                "select * from \"businesses\" where \"businesses\".\"id\" = ? and \"businesses\".\"deleted_at\" is null limit ?": 62,
                "select * from \"products\" where \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 60,
                "select distinct \"l\".\"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                "select sum(\"l\".\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                "select sum(\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"product_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?)": 60,
                "select * from \"retail_intelligence_product_basket_stats\" where \"business_id\" = ? and \"product_id\" = ? and \"location_scope\" = ? and strftime(?, \"window_from\") = cast(? as text) and strftime(?, \"window_to\") = cast(? as text) limit ?": 40,
                "select count(distinct \"l\".\"basket_fact_id\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text) and l.net_quantity >= ?": 40,
                "select \"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"f\" where \"f\".\"business_id\" = ? and \"f\".\"product_id\" = ? and strftime(?, \"f\".\"business_day\") >= cast(? as text) and strftime(?, \"f\".\"business_day\") <= cast(? as text)": 40
            },
            "execution_ms": 128.38,
            "peak_memory_bytes": 342884352
        },
        "20": {
            "products_analyzed": 20,
            "strategies_evaluated": 50,
            "cross_product_evaluated": 50,
            "sql_count": 1086,
            "unique_fingerprints": 52,
            "top_fingerprints": {
                "select * from \"businesses\" where \"businesses\".\"id\" = ? and \"businesses\".\"deleted_at\" is null limit ?": 92,
                "select * from \"products\" where \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 90,
                "select * from \"promotions\" where \"business_id\" = ? and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 60,
                "select distinct \"l\".\"basket_fact_id\" from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                "select sum(\"l\".\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text)": 60,
                "select sum(\"net_quantity\") as aggregate from \"retail_intelligence_basket_product_facts\" where \"business_id\" = ? and \"product_id\" = ? and \"basket_fact_id\" in (?, ?, ?, ?, ?)": 60,
                "select * from \"retail_intelligence_product_basket_stats\" where \"business_id\" = ? and \"product_id\" = ? and \"location_scope\" = ? and strftime(?, \"window_from\") = cast(? as text) and strftime(?, \"window_to\") = cast(? as text) limit ?": 50,
                "select count(distinct \"l\".\"basket_fact_id\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text) and l.net_quantity >= ?": 50
            },
            "execution_ms": 225.46,
            "peak_memory_bytes": 342884352
        },
        "40": {
            "products_analyzed": 40,
            "strategies_evaluated": 70,
            "cross_product_evaluated": 70,
            "sql_count": 1665,
            "unique_fingerprints": 51,
            "top_fingerprints": {
                "select * from \"businesses\" where \"businesses\".\"id\" = ? and \"businesses\".\"deleted_at\" is null limit ?": 152,
                "select * from \"products\" where \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 150,
                "select * from \"promotions\" where \"business_id\" = ? and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 120,
                "select * from \"promotions\" where \"business_id\" is null and \"status\" = ? and (\"location_id\" is null) and (\"starts_at\" is null or \"starts_at\" <= ?) and (\"ends_at\" is null or \"ends_at\" >= ?) and \"promotions\".\"deleted_at\" is null order by \"priority\" asc, \"updated_at\" desc": 80,
                "select * from \"products\" where \"business_id\" = ? and \"products\".\"id\" = ? and \"products\".\"deleted_at\" is null limit ?": 80,
                "select * from \"competitor_product_mappings\" where \"business_id\" = ? and \"product_id\" = ? and \"match_status\" = ?": 80,
                "select * from \"retail_intelligence_product_basket_stats\" where \"business_id\" = ? and \"product_id\" = ? and \"location_scope\" = ? and strftime(?, \"window_from\") = cast(? as text) and strftime(?, \"window_to\") = cast(? as text) limit ?": 70,
                "select count(distinct \"l\".\"basket_fact_id\") as aggregate from \"retail_intelligence_basket_product_facts\" as \"l\" inner join \"retail_intelligence_basket_facts\" as \"b\" on \"b\".\"id\" = \"l\".\"basket_fact_id\" where \"l\".\"business_id\" = ? and \"l\".\"product_id\" = ? and strftime(?, \"l\".\"business_day\") >= cast(? as text) and strftime(?, \"l\".\"business_day\") <= cast(? as text) and l.net_quantity >= ?": 70
            },
            "execution_ms": 540.06,
            "peak_memory_bytes": 342884352
        }
    }
}
.....  915 / 1268 ( 72%)
..................
[perf:600] queries=31 elapsed_ms=46.6
...........................................  976 / 1268 ( 76%)
............................................................. 1037 / 1268 ( 81%)
............................................................. 1098 / 1268 ( 86%)
..................S.......................................... 1159 / 1268 ( 91%)
.................................S........................... 1220 / 1268 ( 96%)
................................................              1268 / 1268 (100%)

Time: 01:03.881, Memory: 337.00 MB

OK, but there were issues!
Tests: 1268, Assertions: 7918, PHPUnit Deprecations: 4, Skipped: 6.
