> ## 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 opstables 1

> Inspect current table indexes, coverage, recommendations and tasks

Required token scopes: `instance|read`



## OpenAPI

````yaml /swagger.json get /admin/observability/table-query-ops/tables/{tableId}
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/tables/{tableId}:
    get:
      tags:
        - admin
        - observability
      description: |-
        Inspect current table indexes, coverage, recommendations and tasks

        Required token scopes: `instance|read`
      parameters:
        - schema:
            type: string
          required: true
          name: tableId
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 720
          required: false
          name: lookbackHours
          in: query
      responses:
        '200':
          description: Current table state and history
          content:
            application/json:
              schema:
                type: object
                properties:
                  table:
                    type: object
                    properties:
                      tableId:
                        type: string
                      tableName:
                        type: string
                      baseId:
                        type: string
                      baseName:
                        type: string
                      spaceId:
                        type: string
                        nullable: true
                      spaceName:
                        type: string
                        nullable: true
                      estimatedRows:
                        type: number
                        nullable: true
                      totalBytes:
                        type: number
                        nullable: true
                      search:
                        type: object
                        properties:
                          method:
                            type: string
                            enum:
                              - pg_bigm
                              - pg_trgm
                              - ilike
                              - unavailable
                          runtimeEnabled:
                            type: boolean
                          configured:
                            type: boolean
                          indexState:
                            type: string
                            enum:
                              - not_configured
                              - pending_publication
                              - ready
                              - unusable
                          configuredProvider:
                            type: string
                            nullable: true
                            enum:
                              - pg_bigm
                              - pg_trgm
                          coveredFieldCount:
                            type: number
                          eligibleFieldCount:
                            type: number
                          uncoveredFieldCount:
                            type: number
                          reason:
                            type: string
                        required:
                          - method
                          - runtimeEnabled
                          - configured
                          - indexState
                          - configuredProvider
                          - coveredFieldCount
                          - eligibleFieldCount
                          - uncoveredFieldCount
                      ordinaryIndexCount:
                        type: number
                        nullable: true
                      pendingRecommendationCount:
                        type: number
                      activeTaskCount:
                        type: number
                      observation:
                        type: object
                        properties:
                          requestCount:
                            type: number
                          slowCount:
                            type: number
                          timeoutCount:
                            type: number
                          maxDurationMs:
                            type: number
                        required:
                          - requestCount
                          - slowCount
                          - timeoutCount
                          - maxDurationMs
                      error:
                        type: string
                    required:
                      - tableId
                      - tableName
                      - baseId
                      - baseName
                      - spaceId
                      - spaceName
                      - estimatedRows
                      - totalBytes
                      - search
                      - ordinaryIndexCount
                      - pendingRecommendationCount
                      - activeTaskCount
                      - observation
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        fieldId:
                          type: string
                        name:
                          type: string
                        type:
                          type: string
                        covered:
                          type: boolean
                        eligible:
                          type: boolean
                        reason:
                          type: string
                      required:
                        - fieldId
                        - name
                        - type
                        - covered
                        - eligible
                  indexes:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        definition:
                          type: string
                        valid:
                          type: boolean
                        purpose:
                          type: string
                          enum:
                            - search
                            - filter_sort
                            - system
                        managed:
                          type: boolean
                        sizeBytes:
                          type: number
                      required:
                        - name
                        - definition
                        - valid
                        - purpose
                        - managed
                  recommendations:
                    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
                  recommendationHistory:
                    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
                  searchHistory:
                    type: array
                    items:
                      type: object
                      properties:
                        provider:
                          type: string
                        status:
                          type: string
                        fieldIds:
                          type: array
                          items:
                            type: string
                        updatedAt:
                          type: string
                      required:
                        - provider
                        - status
                        - fieldIds
                  tasks:
                    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
                  observationWindow:
                    type: object
                    properties:
                      start:
                        type: string
                      end:
                        type: string
                    required:
                      - start
                      - end
                  checkedAt:
                    type: string
                  historyTotals:
                    type: object
                    properties:
                      recommendations:
                        type: number
                      tasks:
                        type: number
                    required:
                      - recommendations
                      - tasks
                required:
                  - table
                  - fields
                  - indexes
                  - recommendations
                  - recommendationHistory
                  - searchHistory
                  - tasks
                  - observationWindow
                  - checkedAt
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request GET \
              --url 'https://app.teable.ai/api/admin/observability/table-query-ops/tables/%7BtableId%7D?lookbackHours=SOME_INTEGER_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: JavaScript
          source: >-
            const url =
            'https://app.teable.ai/api/admin/observability/table-query-ops/tables/%7BtableId%7D?lookbackHours=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/tables/%7BtableId%7D?lookbackHours=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/tables/%7BtableId%7D?lookbackHours=SOME_INTEGER_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


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

````