# Bug OP-13333 - Poor performance of /api/v3/time_entries

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-13333

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 13.0.4 |
| Observed in versions |  |
| Sprint | 13.0.4 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

*Please write down the steps to reproduce. Try to write down all necessary preconditions (what permissions do you have, are other users involved?). Example:*

1.  Have a larger number of time entries
2.  Fetch them via the API /api/v3\_time\_entries

### What is the buggy behavior?

*Please describe the bug in as much detail as possible. Example:*

  - The response is slow since N+1 queries exists for e.g. project, work package and user

### What is the expected behavior?

*Describe how the application should behave like. Example:*

1.  Faster response time

### **Logs**

``` bash
  Setting Maximum (0.3ms)  SELECT MAX("settings"."updated_at") FROM "settings"
  ↳ app/models/setting.rb:316:in `settings_updated_at'
  Token::API Load (0.1ms)  SELECT "tokens".* FROM "tokens" WHERE "tokens"."type" = $1 AND "tokens"."value" = $2 LIMIT $3  [["type", "Token::API"], ["value", "cb098f8edb73f2704b309ba2cfe511405c0bb71c99e54cfafc7fd568c18b7181"], ["LIMIT", 1]]
  ↳ app/models/token/hashed_token.rb:32:in `find_by_plaintext_value'
  User Load (0.1ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ app/models/user.rb:411:in `find_by_api_key'
  TimeEntry Count (11.0ms)  SELECT COUNT("time_entries"."id") FROM "time_entries" WHERE "time_entries"."ongoing" = $1 AND ("time_entries"."project_id" IN (SELECT "projects"."id" FROM "projects" INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('costs') AND "projects"."active" = TRUE WHERE "projects"."active" = TRUE) OR "time_entries"."project_id" IN (SELECT "projects"."id" FROM "projects" INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('costs') AND "projects"."active" = TRUE WHERE "projects"."active" = TRUE) AND "time_entries"."user_id" = 4)  [["ongoing", false]]
  ↳ lib/api/decorators/offset_paginated_collection.rb:92:in `total_count'
  TimeEntry Count (9.8ms)  SELECT COUNT(*) FROM (SELECT 1 AS one FROM "time_entries" WHERE "time_entries"."ongoing" = $1 AND ("time_entries"."project_id" IN (SELECT "projects"."id" FROM "projects" INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('costs') AND "projects"."active" = TRUE WHERE "projects"."active" = TRUE) OR "time_entries"."project_id" IN (SELECT "projects"."id" FROM "projects" INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('costs') AND "projects"."active" = TRUE WHERE "projects"."active" = TRUE) AND "time_entries"."user_id" = 4) ORDER BY "time_entries"."id" DESC LIMIT $2 OFFSET $3) subquery_for_count  [["ongoing", false], ["LIMIT", 20], ["OFFSET", 0]]
  ↳ lib/api/decorators/collection.rb:69:in `block in <class:Collection>'
  TimeEntry Load (10.7ms)  SELECT "time_entries".* FROM "time_entries" WHERE "time_entries"."ongoing" = $1 AND ("time_entries"."project_id" IN (SELECT "projects"."id" FROM "projects" INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('costs') AND "projects"."active" = TRUE WHERE "projects"."active" = TRUE) OR "time_entries"."project_id" IN (SELECT "projects"."id" FROM "projects" INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('costs') AND "projects"."active" = TRUE WHERE "projects"."active" = TRUE) AND "time_entries"."user_id" = 4) ORDER BY "time_entries"."id" DESC LIMIT $2 OFFSET $3  [["ongoing", false], ["LIMIT", 20], ["OFFSET", 0]]
  ↳ lib/api/decorators/collection.rb:77:in `map'
  CustomField Load (0.8ms)  SELECT "custom_fields".* FROM "custom_fields" WHERE "custom_fields"."type" = $1 ORDER BY "custom_fields"."position" ASC  [["type", "TimeEntryCustomField"]]
  ↳ lib/api/v3/utilities/custom_field_injector.rb:396:in `sort_by'
  Project Load (0.5ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  EnabledModule Pluck (1.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 12]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  WorkPackage Load (0.8ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 47], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  TimeEntryActivity Load (0.4ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  Project Load (0.2ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  EnabledModule Pluck (0.1ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  WorkPackage Load (0.1ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 2], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  WorkPackage Load (0.2ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  TimeEntryActivity Load (0.3ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 2], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  Project Load (0.1ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 18], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  EnabledModule Pluck (0.1ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 18]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  WorkPackage Load (0.1ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 53], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 18], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 18]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE WorkPackage Load (0.0ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 53], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 12]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 12]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  WorkPackage Load (0.8ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 10], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE WorkPackage Load (0.0ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 10], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE WorkPackage Load (0.0ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 10], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE WorkPackage Load (0.0ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 2], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE WorkPackage Load (0.0ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 2], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
  ↳ modules/reporting/app/models/entry.rb:110:in `activity'
  CACHE Project Load (0.0ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ modules/costs/app/contracts/time_entries/update_contract.rb:52:in `block in user_allowed_to_update?'
  CACHE EnabledModule Pluck (0.0ms)  SELECT "enabled_modules"."name" FROM "enabled_modules" WHERE "enabled_modules"."project_id" = $1  [["project_id", 1]]
  ↳ app/models/project.rb:427:in `allowed_permissions'
  CACHE WorkPackage Load (0.0ms)  SELECT "work_packages".* FROM "work_packages" WHERE "work_packages"."id" = $1 LIMIT $2  [["id", 2], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."id" = $2 LIMIT $3  [["type", "User"], ["id", 4], ["LIMIT", 1]]
  ↳ lib/api/decorators/link_object.rb:87:in `title'
  CACHE TimeEntryActivity Load (0.0ms)  SELECT "enumerations".* FROM "enumerations" WHERE "enumerations"."type" = $1 AND "enumerations"."id" = $2 ORDER BY enumerations.position ASC LIMIT $3  [["type", "TimeEntryActivity"], ["id", 1], ["LIMIT", 1]]
```
