> ## Documentation Index
> Fetch the complete documentation index at: https://help.teable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get adminobservabilitytable query ops

> Get Table Query Ops observation, recommendation, and task overview

Required token scopes: `instance|read`



## OpenAPI

````yaml /swagger.json get /admin/observability/table-query-ops
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
tags:
  - name: base
    x-group: project
  - name: base node
    x-group: project node
  - name: base-share
    x-group: project-share
paths:
  /admin/observability/table-query-ops:
    get:
      tags:
        - admin
        - observability
      description: |-
        Get Table Query Ops observation, recommendation, and task overview

        Required token scopes: `instance|read`
      parameters:
        - schema:
            type: string
            minLength: 1
          required: false
          name: organizationId
          in: query
        - schema:
            type: string
            minLength: 1
          required: false
          name: spaceId
          in: query
        - schema:
            type: string
            minLength: 1
          required: false
          name: baseId
          in: query
        - schema:
            type: string
            minLength: 1
          required: false
          name: tableId
          in: query
        - schema:
            type: string
            enum:
              - open
              - accepted
              - dismissed
              - superseded
          required: false
          name: recommendationStatus
          in: query
        - schema:
            type: string
            enum:
              - none
              - low
              - medium
              - high
              - critical
          required: false
          name: riskLevel
          in: query
        - schema:
            type: string
            enum:
              - queued
              - running
              - succeeded
              - failed
              - cancelled
          required: false
          name: taskStatus
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
          required: false
          name: recommendationSkip
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          required: false
          name: recommendationTake
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
          required: false
          name: taskSkip
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          required: false
          name: taskTake
          in: query
        - schema:
            type: boolean
            nullable: true
          required: false
          name: includeSearchAccessPaths
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
          required: false
          name: skip
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          required: false
          name: take
          in: query
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  summary:
                    type: object
                    properties:
                      enabled:
                        type: boolean
                      observationWindowCount:
                        type: number
                      requestCount:
                        type: number
                      slowCount:
                        type: number
                      timeoutCount:
                        type: number
                      dbErrorCount:
                        type: number
                      openRecommendationCount:
                        type: number
                      acceptedRecommendationCount:
                        type: number
                      runningTaskCount:
                        type: number
                      failedTaskCount:
                        type: number
                      searchAccessPathReadyCount:
                        type: number
                      searchAccessPathDegradedCount:
                        type: number
                      searchAccessPathRuntimeEnabled:
                        type: boolean
                      oldestQueuedTaskAgeMs:
                        type: number
                    required:
                      - enabled
                      - observationWindowCount
                      - requestCount
                      - slowCount
                      - timeoutCount
                      - dbErrorCount
                      - openRecommendationCount
                      - acceptedRecommendationCount
                      - runningTaskCount
                      - failedTaskCount
                      - searchAccessPathReadyCount
                      - searchAccessPathDegradedCount
                      - searchAccessPathRuntimeEnabled
                  trackA:
                    type: object
                    properties:
                      sources:
                        type: array
                        items:
                          type: object
                          properties:
                            source:
                              type: string
                              enum:
                                - slow_query_observation
                                - saved_view_config
                                - manual_admin
                                - otel_import
                                - sentry_import
                                - pg_stat_statements
                                - system_policy
                            label:
                              type: string
                            status:
                              type: string
                              enum:
                                - active
                                - ready
                                - planned
                                - blocked
                            signalCount:
                              type: number
                            recommendationCount:
                              type: number
                            taskCount:
                              type: number
                            note:
                              type: string
                          required:
                            - source
                            - label
                            - status
                            - signalCount
                            - recommendationCount
                            - taskCount
                            - note
                      accessPaths:
                        type: array
                        items:
                          type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - pg_btree_index
                                - pg_trgm_index
                                - generated_substring_search
                                - generated_tsvector
                                - repair_index
                                - manual_investigation
                                - search_document
                                - query_cache
                                - materialized_counter
                                - query_rewrite
                            label:
                              type: string
                            track:
                              type: string
                              enum:
                                - A
                                - B
                                - C
                            status:
                              type: string
                              enum:
                                - active
                                - ready
                                - planned
                                - blocked
                            recommendationCount:
                              type: number
                            taskCount:
                              type: number
                            note:
                              type: string
                          required:
                            - kind
                            - label
                            - track
                            - status
                            - recommendationCount
                            - taskCount
                            - note
                      indexInventory:
                        type: object
                        properties:
                          observedTableCount:
                            type: number
                          inspectedTableCount:
                            type: number
                          usefulIndexCount:
                            type: number
                          missingIndexCandidateCount:
                            type: number
                          abnormalIndexCount:
                            type: number
                          externalIndexCount:
                            type: number
                          lastObservationTime:
                            type: string
                        required:
                          - observedTableCount
                          - inspectedTableCount
                          - usefulIndexCount
                          - missingIndexCandidateCount
                          - abnormalIndexCount
                          - externalIndexCount
                    required:
                      - sources
                      - accessPaths
                      - indexInventory
                  hotTables:
                    type: array
                    items:
                      type: object
                      properties:
                        spaceId:
                          type: string
                          nullable: true
                        baseId:
                          type: string
                        tableId:
                          type: string
                        spaceName:
                          type: string
                          nullable: true
                        baseName:
                          type: string
                        tableName:
                          type: string
                        requestCount:
                          type: number
                        slowCount:
                          type: number
                        timeoutCount:
                          type: number
                        dbErrorCount:
                          type: number
                        maxDurationMs:
                          type: number
                        latestWindowStart:
                          type: string
                      required:
                        - spaceId
                        - baseId
                        - tableId
                        - requestCount
                        - slowCount
                        - timeoutCount
                        - dbErrorCount
                        - maxDurationMs
                  searchAccessPaths:
                    type: array
                    items:
                      type: object
                      properties:
                        spaceId:
                          type: string
                          nullable: true
                        baseId:
                          type: string
                        tableId:
                          type: string
                        spaceName:
                          type: string
                          nullable: true
                        baseName:
                          type: string
                        tableName:
                          type: string
                        provider:
                          type: string
                          enum:
                            - pg_bigm
                            - pg_trgm
                        status:
                          type: string
                          enum:
                            - ready
                            - stale
                            - rebuild_pending
                        coveredSearchableFieldCount:
                          type: integer
                          nullable: true
                          minimum: 0
                        currentEligibleFieldCount:
                          type: integer
                          nullable: true
                          minimum: 0
                        uncoveredFieldCount:
                          type: integer
                          nullable: true
                          minimum: 0
                      required:
                        - spaceId
                        - baseId
                        - tableId
                        - provider
                        - status
                        - coveredSearchableFieldCount
                        - currentEligibleFieldCount
                        - uncoveredFieldCount
                  recommendations:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            spaceId:
                              type: string
                              nullable: true
                            baseId:
                              type: string
                            tableId:
                              type: string
                            spaceName:
                              type: string
                              nullable: true
                            baseName:
                              type: string
                            tableName:
                              type: string
                            executionTarget:
                              type: object
                              properties:
                                storage:
                                  type: string
                                  enum:
                                    - default
                                    - byodb
                                displayHost:
                                  type: string
                                displayDatabase:
                                  type: string
                                internalSchema:
                                  type: string
                              required:
                                - storage
                            shapeHash:
                              type: string
                            policyVersion:
                              type: string
                            status:
                              type: string
                              enum:
                                - open
                                - accepted
                                - dismissed
                                - superseded
                            riskLevel:
                              type: string
                              enum:
                                - none
                                - low
                                - medium
                                - high
                                - critical
                            riskScore:
                              type: number
                            reasonCodes:
                              type: array
                              items:
                                type: string
                            remediationKinds:
                              type: array
                              items:
                                type: string
                            remediationCandidates:
                              type: array
                              items:
                                type: object
                                properties:
                                  kind:
                                    type: string
                                  reason:
                                    type: string
                                  executableInPhase1:
                                    type: boolean
                                  fieldId:
                                    type: string
                                  fieldDbName:
                                    type: string
                                  indexKind:
                                    type: string
                                  accessPath:
                                    type: string
                                  fields:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        fieldId:
                                          type: string
                                        fieldDbName:
                                          type: string
                                        direction:
                                          type: string
                                          enum:
                                            - asc
                                            - desc
                                        role:
                                          type: string
                                required:
                                  - kind
                                  - reason
                                  - executableInPhase1
                            trigger:
                              type: object
                              properties:
                                sourceKind:
                                  type: string
                                  enum:
                                    - saved_view_config
                                    - runtime_observation
                                    - relation_field_config
                                    - unknown
                                sourceId:
                                  type: string
                                viewId:
                                  type: string
                                fingerprint:
                                  type: string
                                observedWorkload:
                                  type: boolean
                              required:
                                - sourceKind
                                - observedWorkload
                            shapeSummary:
                              type: object
                              properties:
                                filterFields:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      fieldId:
                                        type: string
                                      operatorFamily:
                                        type: string
                                      sourceKind:
                                        type: string
                                    required:
                                      - fieldId
                                      - operatorFamily
                                sortFields:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      fieldId:
                                        type: string
                                      systemColumn:
                                        type: string
                                      direction:
                                        type: string
                                        enum:
                                          - asc
                                          - desc
                                      source:
                                        type: string
                                    required:
                                      - direction
                                      - source
                                search:
                                  type: object
                                  properties:
                                    fieldCount:
                                      type: number
                                    allFields:
                                      type: boolean
                                    valueLengthBucket:
                                      type: string
                                  required:
                                    - fieldCount
                                    - allFields
                                    - valueLengthBucket
                              required:
                                - filterFields
                                - sortFields
                            queryKind:
                              type: string
                            sqlDiagnostics:
                              type: array
                              items:
                                type: object
                                properties:
                                  source:
                                    type: string
                                  statementKind:
                                    type: string
                                  fingerprint:
                                    type: string
                                  parameterCount:
                                    type: number
                                  sampled:
                                    type: boolean
                                  normalizedSql:
                                    type: string
                                required:
                                  - source
                                  - statementKind
                                  - fingerprint
                                  - parameterCount
                                  - sampled
                            planValidation:
                              type: object
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - validated
                                    - skipped
                                    - failed
                                method:
                                  type: string
                                  enum:
                                    - explain
                                    - hypothetical_index
                                reason:
                                  type: string
                                candidateCount:
                                  type: number
                                startupCostBefore:
                                  type: number
                                startupCostAfter:
                                  type: number
                                totalCostBefore:
                                  type: number
                                totalCostAfter:
                                  type: number
                                planNodeBefore:
                                  type: string
                                planNodeAfter:
                                  type: string
                                usesCandidateIndex:
                                  type: boolean
                                indexStatements:
                                  type: array
                                  items:
                                    type: string
                                errors:
                                  type: array
                                  items:
                                    type: string
                              required:
                                - status
                                - candidateCount
                            createdTime:
                              type: string
                            lastModifiedTime:
                              type: string
                            priorityScore:
                              type: number
                            heat:
                              type: object
                              properties:
                                requestCount:
                                  type: number
                                slowCount:
                                  type: number
                                timeoutCount:
                                  type: number
                                totalDurationMs:
                                  type: number
                                maxDurationMs:
                                  type: number
                                estimatedRows:
                                  type: number
                                  nullable: true
                                seqScanCount:
                                  type: number
                                indexScanCount:
                                  type: number
                              required:
                                - requestCount
                                - slowCount
                                - timeoutCount
                                - totalDurationMs
                                - maxDurationMs
                                - estimatedRows
                            decision:
                              type: object
                              properties:
                                action:
                                  type: string
                                  enum:
                                    - auto_accept
                                    - hold
                                    - reclaim
                                    - noop
                                actor:
                                  type: string
                                  enum:
                                    - system_policy
                                    - admin
                                outcome:
                                  type: string
                                  enum:
                                    - pending
                                    - executed
                                    - post_verify_failed
                                    - skipped
                                wouldAutoAccept:
                                  type: boolean
                                reasonCodes:
                                  type: array
                                  items:
                                    type: string
                                cooldownUntil:
                                  type: string
                                decidedAt:
                                  type: string
                              required:
                                - action
                                - actor
                                - outcome
                                - wouldAutoAccept
                                - reasonCodes
                          required:
                            - id
                            - spaceId
                            - baseId
                            - tableId
                            - executionTarget
                            - shapeHash
                            - policyVersion
                            - status
                            - riskLevel
                            - riskScore
                            - reasonCodes
                            - remediationKinds
                            - sqlDiagnostics
                            - priorityScore
                      total:
                        type: number
                    required:
                      - data
                      - total
                  tasks:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            recommendationId:
                              type: string
                              nullable: true
                            baseId:
                              type: string
                            tableId:
                              type: string
                            baseName:
                              type: string
                            tableName:
                              type: string
                            kind:
                              type: string
                            status:
                              type: string
                              enum:
                                - queued
                                - running
                                - succeeded
                                - failed
                                - cancelled
                            attempts:
                              type: number
                            maxAttempts:
                              type: number
                            lockedBy:
                              type: string
                              nullable: true
                            lockedAt:
                              type: string
                              nullable: true
                            lastError:
                              type: string
                              nullable: true
                            result:
                              nullable: true
                            createdTime:
                              type: string
                            lastModifiedTime:
                              type: string
                          required:
                            - id
                            - recommendationId
                            - baseId
                            - tableId
                            - kind
                            - status
                            - attempts
                            - maxAttempts
                      total:
                        type: number
                    required:
                      - data
                      - total
                required:
                  - summary
                  - trackA
                  - hotTables
                  - searchAccessPaths
                  - recommendations
                  - tasks
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request GET \
              --url 'https://app.teable.ai/api/admin/observability/table-query-ops?organizationId=SOME_STRING_VALUE&spaceId=SOME_STRING_VALUE&baseId=SOME_STRING_VALUE&tableId=SOME_STRING_VALUE&recommendationStatus=SOME_STRING_VALUE&riskLevel=SOME_STRING_VALUE&taskStatus=SOME_STRING_VALUE&recommendationSkip=SOME_INTEGER_VALUE&recommendationTake=SOME_INTEGER_VALUE&taskSkip=SOME_INTEGER_VALUE&taskTake=SOME_INTEGER_VALUE&includeSearchAccessPaths=SOME_BOOLEAN_VALUE&skip=SOME_INTEGER_VALUE&take=SOME_INTEGER_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: JavaScript
          source: >-
            const url =
            'https://app.teable.ai/api/admin/observability/table-query-ops?organizationId=SOME_STRING_VALUE&spaceId=SOME_STRING_VALUE&baseId=SOME_STRING_VALUE&tableId=SOME_STRING_VALUE&recommendationStatus=SOME_STRING_VALUE&riskLevel=SOME_STRING_VALUE&taskStatus=SOME_STRING_VALUE&recommendationSkip=SOME_INTEGER_VALUE&recommendationTake=SOME_INTEGER_VALUE&taskSkip=SOME_INTEGER_VALUE&taskTake=SOME_INTEGER_VALUE&includeSearchAccessPaths=SOME_BOOLEAN_VALUE&skip=SOME_INTEGER_VALUE&take=SOME_INTEGER_VALUE';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            REPLACE_BEARER_TOKEN'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'GET',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/admin/observability/table-query-ops?organizationId=SOME_STRING_VALUE&spaceId=SOME_STRING_VALUE&baseId=SOME_STRING_VALUE&tableId=SOME_STRING_VALUE&recommendationStatus=SOME_STRING_VALUE&riskLevel=SOME_STRING_VALUE&taskStatus=SOME_STRING_VALUE&recommendationSkip=SOME_INTEGER_VALUE&recommendationTake=SOME_INTEGER_VALUE&taskSkip=SOME_INTEGER_VALUE&taskTake=SOME_INTEGER_VALUE&includeSearchAccessPaths=SOME_BOOLEAN_VALUE&skip=SOME_INTEGER_VALUE&take=SOME_INTEGER_VALUE',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN'
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }


            conn.request("GET",
            "/api/admin/observability/table-query-ops?organizationId=SOME_STRING_VALUE&spaceId=SOME_STRING_VALUE&baseId=SOME_STRING_VALUE&tableId=SOME_STRING_VALUE&recommendationStatus=SOME_STRING_VALUE&riskLevel=SOME_STRING_VALUE&taskStatus=SOME_STRING_VALUE&recommendationSkip=SOME_INTEGER_VALUE&recommendationTake=SOME_INTEGER_VALUE&taskSkip=SOME_INTEGER_VALUE&taskTake=SOME_INTEGER_VALUE&includeSearchAccessPaths=SOME_BOOLEAN_VALUE&skip=SOME_INTEGER_VALUE&take=SOME_INTEGER_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````