GET http://cryptointerface.io/demo-v1.12/user/rating_statistic/4

Query Metrics

10 Database Queries
9 Different statements
18.73 ms Query time
0 Invalid entities

Grouped Statements

Show all queries

Time Count Info
8.03 ms
(42.90%)
1
WITH monthly AS (
  SELECT
    EXTRACT(YEAR FROM data)  AS year,
    EXTRACT(MONTH FROM data) AS month,
    SUM(rating)              AS sum_rating,
    COUNT(*)                 AS cnt
  FROM rating
  WHERE investment_id = :invId
    AND data <= :currentDate
  GROUP BY year, month
)
SELECT
  year,
  month,
  ROUND(
    (
      SUM(sum_rating) OVER (ORDER BY year, month)
      /
      NULLIF(SUM(cnt) OVER (ORDER BY year, month), 0)
    )::numeric
  , 1) AS avg_rating
FROM monthly
ORDER BY year, month
Parameters:
[
  "invId" => 4
  "currentDate" => "2028-06-05"
]
1.90 ms
(10.13%)
2
WITH monthly AS (
  SELECT
    EXTRACT(YEAR  FROM data)  AS year,
    EXTRACT(MONTH FROM data)  AS month,
    AVG(rating)               AS avg_rating
  FROM rating
  WHERE investment_id = :invId
    AND data <= :currentDate
    AND is_user = :isUser
  GROUP BY year, month
)
SELECT
  year,
  month,
  ROUND(avg_rating::numeric, 1) AS avg_rating
FROM monthly
ORDER BY year, month
Parameters:
[
  "invId" => 4
  "currentDate" => "2028-06-05"
  "isUser" => true
]
1.71 ms
(9.15%)
1
SELECT n0_.id AS id_0, n0_.title AS title_1, n0_.description AS description_2, n0_.readed AS readed_3, n0_.add_date AS add_date_4, n0_.read_date AS read_date_5, n0_.image AS image_6, n0_.style AS style_7 FROM notification n0_ WHERE n0_.readed = ? ORDER BY n0_.add_date DESC
Parameters:
[
  0
]
1.53 ms
(8.16%)
1
SELECT t0.id AS id_1, t0.smart_contract AS smart_contract_2, t0.name AS name_3, t0.company_name AS company_name_4, t0.location AS location_5, t0.country AS country_6, t0.country_flag AS country_flag_7, t0.description AS description_8, t0.rate AS rate_9, t0.category AS category_10, t0.amount AS amount_11, t0.amount_collected AS amount_collected_12, t0.waiting_people AS waiting_people_13, t0.people AS people_14, t0.economic_rating AS economic_rating_15, t0.legal_rating AS legal_rating_16, t0.community_rating AS community_rating_17, t0.favorite AS favorite_18, t0.start_date AS start_date_19, t0.end_date AS end_date_20 FROM investment t0 WHERE t0.id = ?
Parameters:
[
  4
]
1.51 ms
(8.04%)
1
SELECT
  EXTRACT(YEAR FROM data)::int    AS year,
  ROUND(AVG(rating)::numeric, 1)  AS avg_rating
FROM rating
WHERE investment_id = :invId
  AND data <= :currentDate
GROUP BY year
ORDER BY year
Parameters:
[
  "invId" => 4
  "currentDate" => "2028-06-05"
]
1.21 ms
(6.48%)
1
SELECT
  EXTRACT(YEAR  FROM data) AS year,
  EXTRACT(MONTH FROM data) AS month,
  COUNT(*)               AS cnt
FROM rating
WHERE investment_id = :invId
  AND data <= :currentDate
GROUP BY year, month
ORDER BY year, month
Parameters:
[
  "invId" => 4
  "currentDate" => "2028-06-05"
]
1.17 ms
(6.25%)
1
SELECT
  rating  AS value,
  COUNT(*) AS cnt
FROM rating
WHERE investment_id = :invId
  AND data <= :currentDate
GROUP BY rating
ORDER BY rating
Parameters:
[
  "invId" => 4
  "currentDate" => "2028-06-05"
]
1.00 ms
(5.34%)
1
SELECT
  is_user,
  COUNT(*) AS cnt
FROM rating
WHERE investment_id = :invId
  AND data <= :currentDate
GROUP BY is_user
Parameters:
[
  "invId" => 4
  "currentDate" => "2028-06-05"
]
0.66 ms
(3.54%)
1
SELECT AVG(r0_.rating) AS sclr_0 FROM rating r0_ WHERE r0_.investment_id = ? AND r0_.data <= ?
Parameters:
[
  4
  "2028-06-05 01:36:00"
]

Database Connections

Name Service
default doctrine.dbal.default_connection

Entity Managers

Name Service
default doctrine.orm.default_entity_manager

Second Level Cache

Second Level Cache is not enabled.

Entities Mapping

Class Mapping errors
App\Entity\Rating No errors.
App\Entity\Investment No errors.
App\Entity\WaitingLine No errors.
App\Entity\Notification No errors.