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 lets you export results.
How it works¶
Every query you run becomes a job on the MetaMiner Server (MMS) 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. What you can see is limited to the tables your tier may read.
The same app is also available inside the BO console as the MetaQuery module, sharing your sign-in. For the MetaMiner Client version, see Meta Query.
Before you begin¶
- Enable the web console (/web/metaquery) is on: see Enable the Web Console.
- 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."
- You can sign in: see Sign In.
Open it¶
- In the MetaMiner Client (MMC) choose File > Launch MetaQuery Web...,
- in the BO console sidebar choose MetaQuery, or
- open
https://<mms-host>:<port>/web/metaquery/.
Image of the MetaQuery workspace: schema tree on the left with BusinessObjects and Tableau nodes, two editor tabs, a SELECT statement, and the result grid with row count and Download CSV / Download XLSX
../images/web-console/metaquery-workspace.png
Workspace¶
| 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 (filter tables and columns). 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 identifier of an environment for use in a WHERE clause. |
| Result grid | Rows of the current tab's last run, with keyboard navigation, cell inspection (++enter++), copy as tab-separated text (++ctrl+c++) and Search results |
| Top bar | History, Catalog, Activity, Preferences, and Open MetaQuery in a new window |
Your open tabs are saved on the server for your user, so they come back on another browser or computer. Press ++ctrl+k++ for the command palette.
Run a query¶
- Type or paste a statement. On an empty tab, click one of the examples under "Try one:".
- Press
++ctrl+enter++or++f5++. MetaQuery runs the selection, or the statement under the cursor. - Watch the status: queued, running, then the row count and duration.
- To stop it, press
++escape++or click Stop.
Result: the grid fills with the first page of rows; scroll to load more. When the result hit 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 shows the plan without running the query. EXPLAIN ANALYZE runs it and is allowed for MMDB administrators by default (server property web.metaquery.explain.analyze.enabled: none, admin or all).
Export results¶
Use Download CSV or Download XLSX on the result (or Export CSV / Export XLSX in the command palette). The export 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), with state and text filters and a Distinct SQL switch. Actions: Open result, Re-run, Open in editor, Save to catalog, Delete from history. |
| Catalog | Saved queries: Saved queries (yours) and Shared. One search box over name, folder, description, tags, owner and optionally the SQL (Search in SQL). Preview, Open in editor, Copy SQL, Delete, and the version list with Restore this version. |
| Activity | Queries running now with their database state and elapsed time, and a Stop button. Users see their own; MMDB administrators see everyone's. |
To save a query, press ++ctrl+s++ (Save to catalog) and fill in Name, Folder, Description and Tags. Tick Shared: everyone who signs in can read and run it to share it. Saving changed SQL creates a new version; the last 20 versions are kept.
Image of the MetaQuery Catalog page: the Saved queries / Shared tabs, a search with matches boxed, and the preview pane with highlighted SQL and the Versions list
../images/web-console/metaquery-catalog.png
Anonymous use keeps no server history and no saved queries; open tabs keep their last result only.
E-mail when a query finishes¶
- Open Preferences.
- Under Email, check the address in "Mail goes to ...". If it says "There is no email on your MetaMiner user", ask an administrator to add one to your MetaMiner user.
- Choose the options:
- A query that runs longer than 2 minutes is e-mailed when it finishes after you have left the page (server property
web.metaquery.notify.after.sec, default120). - Email me every time a query finishes
- Attach the result as CSV (up to 5 MB)
- A query that runs longer than 2 minutes is e-mailed when it finishes after you have left the page (server property
- Click Send a test email to check delivery.
Under Desktop, Notify me on the desktop when a query finishes while this tab is hidden uses browser notifications, which browsers allow only on HTTPS pages or on the server itself.
The e-mail links back to the result. If users reach the MMS under a different address than the server knows itself by (for example through a load balancer), set that address in web.metaquery.public.url. E-mail uses the MMS mail settings: see Email.
Image of MetaQuery Preferences, Email section: Mail goes to, the two-minute note, the two check boxes and Send a test email
../images/web-console/metaquery-preferences-email.png
Limits per tier¶
Statement timeout and row cap are set in the MMA on Preferences > Settings... > MetaQuery, group Web console (columns Timeout (s) and Row cap). 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 further limits 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 |
| SQL text size | 256 KB | 256 KB | 64 KB | sql.max.bytes |
Server-wide: 3 queries run at the same time (workers), 12 can wait (queue.max), stored results use at most 8 GB on disk (spool.budget.bytes, oldest removed first) under server\data\mq-spool, and history entries are kept 90 days (job.retention.days).
Troubleshooting¶
"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.
Relation does not exist
Tables outside the public schema need the schema prefix, for example tableau.workbooks. The schema tree shows the qualified names.
A query is already running in this tab
Stop it, or open a new tab (++alt+n++).
The sign-in box says the web console is turned off
Ask an administrator to tick Enable the web console (/web/metaquery) in the MMA.