<@U04S8PLJWMT> why is it that airbyte puts a lock ...
# ask-ai
e
@kapa.ai why is it that airbyte puts a lock on the actor table with this query:
Copy code
select count(*) from (select distinct "public"."connection"."id" from "public"."connection" join "public"."actor" on "public"."connection"."source_id" = "public"."actor"."id" join "public"."actor" as "dest_actor" on "public"."connection"."destination_id" = "dest_actor"."id" left outer join "public"."connection_tag" on "public"."connection_tag"."connection_id" = "public"."connection"."id" left outer join lateral (select "public"."jobs"."scope", "public"."jobs"."status", "public"."jobs"."created_at" from "public"."jobs" where ("public"."jobs"."config_type" = cast($1 as "public"."job_config_type") and "public"."jobs"."scope" = cast("public"."connection"."id" as varchar)) order by "public"."jobs"."updated_at" desc fetch next $2 rows only) as "latest_jobs" on true where ("public"."actor"."workspace_id" = cast($3 as uuid) and "public"."connection"."status" <> cast($4 as "public"."status_type"))) as "filtered_connections"
k
I'm sorry, but the knowledge sources do not contain explicit information about why Airbyte puts a lock on the actor table when executing the provided query. The documentation describes the structure and relationships of the relevant tables (such as actor, connection, and their foreign key constraints), but it does not discuss query execution plans, locking behavior, or the rationale behind specific SQL queries and their impact on database locks. If you are experiencing locking issues with this query, it may be related to how your database engine handles joins and concurrent access, especially given the multiple joins and subqueries involved. However, this is not directly addressed in the Airbyte documentation provided. For further insight, you may need to consult your database's documentation or analyze the query execution plan in your specific environment. If you have a specific scenario or error message related to locking, please provide more details, and I can help look for any related information in the Airbyte documentation.