Query timing out using Saved Questions, while Saved Question itself runs fine

Hi there,
I am trying to use Saved Questions as recommended here.
Issue I have is the following: query that uses the Saved Questions times out.
Please note :

  • The query using the Saved Questions runs if I limit the daterange in the Saved Question to 1 or 2 days
  • The Saved Questions runs fine, up to 30 days of database history
  • Query using the Saved Question is a simple
    SELECT * FROM {{question_id}} internal

explain analyse output for Saved Question
Finalize GroupAggregate (cost=141097.44..145889.71 rows=7279 width=800) (actual time=633.276..1950.591 rows=43133 loops=1)

explain analyse output for Query using Saved Question
Subquery Scan on internal (cost=137463.48..138512.15 rows=7273 width=16) (actual time=443.549..606.804 rows=43176 loops=1)

Thank you for your help

1 Like

Hi @theo_ubble
Post "Diagnostic Info" from Admin > Troubleshooting.

Thank you for getting back, please see below

{
  "browser-info": {
    "language": "en-US",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.11+9",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.11",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.11+9",
    "os.name": "Linux",
    "os.version": "4.9.0-11-amd64",
    "user.language": "en",
    "user.timezone": "UTC"
  },
  "metabase-info": {
    "databases": [
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "12.4 (Ubuntu 12.4-1.pgdg18.04+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.18"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2021-05-27",
      "tag": "v0.39.3",
      "branch": "release-x.39.x",
      "hash": "598a112"
    },
    "settings": {
      "report-timezone": "UTC"
    }
  }
}

@theo_ubble
Upgrade to a newer release immediately:
https://github.com/metabase/metabase/security/advisories/GHSA-vmm4-cwrm-38rj

The issue you're referring to was fixed some months ago:
https://github.com/metabase/metabase/issues/13572

1 Like

Thank you flamber, and indeed I hadn't seen this issue. We'll upgrade very soon
Best,

1 Like