Skip to content

Meta Query on the Web

Meta Query on the web is a browser SQL workbench that runs read-only queries against the MetaMiner Database (MMDB), keeps your history and saved queries, and exports results.

How it works

Every query you run becomes a job on the server side. The job runs in a read-only database session with the limits of your tier, stores its result on the server, and keeps running if you close the browser tab. The page polls the job, pages the rows into the result grid and reattaches when you come back.

Only reading statements run: one statement at a time, starting with SELECT, WITH, TABLE, VALUES, EXPLAIN or SHOW. You see only the tables your tier may read. Power BI and Fabric data is in the pbi schema.

For the MetaMiner Client (MMC) version, see Meta Query.

Before you begin

  • The server has a MetaMiner Ultimate licence. Without it the workspace shows "The web console needs a MetaMiner Ultimate licence; queries cannot run on this server."
  • MetaMiner user-based security is on, so that users can sign in. See User-Based Security.
  • MMS SSL is on, or users open the page only on the MMS machine. See SSL Overview.

Turn it on

MMA label MMA page Server property Default
Enable the web console (/web/metaquery) MetaQuery, group Web console web.metaquery.enabled false
Allow anonymous use (lower limits, nothing saved) same allow.anonymous.web.metaquery false
Allow sign-in over plain HTTP (password sent unencrypted) same web.metaquery.http.signin false
  1. In the MetaMiner Administrator (MMA), choose Preferences > Settings... and select the MetaQuery page.
  2. In the Web console group, tick Enable the web console (/web/metaquery).
  3. Leave Allow anonymous use and Allow sign-in over plain HTTP unticked unless you have a reason.
  4. Review Timeout (s) and Row cap per tier (see Limits per tier) and save.

Image of the MMA Settings dialog, MetaQuery page, Web console group: Enable the web console ticked, the two Allow options unticked, and the Timeout (s) / Row cap grid for Users, MMDB administrators and Anonymous

../images/dashboards/mma-settings-metaquery-web.png

Sign in

  1. Open https://<mms-host>:<port>/web/metaquery/, or choose File > Launch MetaQuery Web... in the MMC.
  2. Enter your MetaMiner user and Password and click Sign in.
  3. If anonymous use is allowed, you can click Continue without signing in instead.
Who can sign in Tier
MetaMiner users with the Tab: Meta Query permission on at least one enabled environment Users
MMDB administrators MMDB administrators (higher limits; see every user's queries)
Anyone, when anonymous use is allowed Anonymous (lowest limits, nothing saved on the server)

From another computer, sign-in works over HTTPS only, unless plain-HTTP sign-in is allowed. Repeated failed attempts from one address are limited per minute ("Too many sign-in attempts from this address; wait a minute.").

Session rule Default Server property
Idle timeout 60 minutes web.metaquery.session.idle.min
Absolute lifetime 12 hours web.metaquery.session.absolute.hours

Image of the MetaQuery sign-in box with MetaMiner user, Password and Sign in

../images/dashboards/metaquery-sign-in.png

Workspace

Image of the MetaQuery workspace: schema tree with the pbi schema expanded, an editor tab with a query on pbi.datasets, and the result grid with Download CSV / Download XLSX

../images/dashboards/metaquery-workspace.png

Area What it does
Schema tree (left) Tables and views grouped by product and schema, with row estimates, column types and comments. Filter by name. Right-click for Copy name, Copy qualified name and Columns to editor. Refresh the catalog reloads it.
Editor tabs Several queries side by side, with completion (++ctrl+space++), formatting (++ctrl+shift+f++) and find/replace. Right-click Insert Env ID inserts the ID of a Power BI environment for a WHERE clause.
Result grid Rows of the current tab's last run, with keyboard navigation, cell inspection (++enter++), copy (++ctrl+c++) and Search results
Top bar History, Catalog, Activity, Preferences, Open MetaQuery in a new window

Your open tabs are saved on the server for your user. Press ++ctrl+k++ for the command palette.

Run a query

  1. Type a statement. On an empty tab, click an example under "Try one:", such as Power BI datasets by environment.
  2. Press ++ctrl+enter++ or ++f5++. MetaQuery runs the selection, or the statement under the cursor.
  3. Watch the status: queued, running, then the row count and duration. Press ++escape++ or click Stop to cancel.
Power BI datasets by environment (built-in example)
SELECT env_id, count(*) AS datasets
FROM pbi.datasets
WHERE NOT is_deleted
GROUP BY 1
ORDER BY 2 DESC;

When a result hits your row cap or the size cap, the footer reads "first N rows (the row or size cap)": add ORDER BY and LIMIT, or export. EXPLAIN ANALYZE is allowed for MMDB administrators by default (web.metaquery.explain.analyze.enabled: none, admin or all).

Export results

Download CSV or Download XLSX streams the whole stored result, not only the rows on screen.

History, Catalog and Activity

Page What it shows
History Your runs, newest first (MMDB administrators can choose All users). Open result, Re-run, Open in editor, Save to catalog, Delete from history.
Catalog Saved queries (yours) and Shared, with search, preview, versions and Restore this version. Press ++ctrl+s++ to save; tick Shared: everyone who signs in can read and run it to share. The last 20 versions are kept.
Activity Queries running now, with a Stop button. Users see their own; MMDB administrators see everyone's.

Under Preferences > Email you can have long queries e-mailed when they finish (after 120 seconds by default, web.metaquery.notify.after.sec), with an optional CSV attachment up to 5 MB. If users reach the server under another address (for example a load balancer), set it in web.metaquery.public.url so the e-mail links work. Mail uses the server's Email settings.

Limits per tier

Set in the MMA on the MetaQuery page, group Web console. They take effect within a minute.

Limit Users MMDB administrators Anonymous Server property
Statement timeout 600 s 1800 s 120 s web.metaquery.timeout.sec.user / .admin / .anon
Row cap per result 1,000,000 5,000,000 100,000 web.metaquery.rowcap.user / .admin / .anon

These are read when the Web Apps service starts (restart the MetaMiner Server after changing them in server\config\config.json):

Limit Users MMDB administrators Anonymous Property (web.apps.metaquery. + ...)
Queries running at once per user 2 4 1 running.per.owner.user / .admin / .anon
Queries waiting per user 3 6 1 queued.per.owner.user / .admin / .anon
Runs per hour per user 600 1200 60 submits.per.hour.user / .admin / .anon
Stored result size per query 512 MB 2 GB 64 MB spool.job.max.bytes.user / .admin / .anon
Result kept for 24 h 72 h 2 h spool.ttl.hours.user / .admin / .anon

Server-wide: 3 queries run at the same time (workers), 12 can wait (queue.max), stored results use at most 8 GB under server\data\mq-spool (spool.budget.bytes, oldest removed first), and history is kept 90 days (job.retention.days).

Troubleshooting

The sign-in box says the web console is turned off

Tick Enable the web console (/web/metaquery) on the MMA MetaQuery page.

"User security is off on this MetaMiner server; sign-in is unavailable."

Turn on user-based security, or allow anonymous use. See User-Based Security.

Sign-in needs HTTPS

You opened the page over plain HTTP from another computer. Turn on MMS SSL and open it with https://.

Relation does not exist

Prefix tables with their schema, for example pbi.workspaces. The schema tree shows qualified names.

"Stopped at its ... limit after ...; nothing was kept."

The query hit your tier's statement timeout. Add filters or a LIMIT, or ask an administrator for a longer limit.

Next steps