Azure Postgres & Query Performance Insight: Query text not showing - postgresql

I have enabled Query Performance Insights, however, the Query Text fields are left empty, as you can see from the screenshot below.
I have enabled the Query Store as described in the documentation, everything else has been left to its default values.
pg_qs.query_capture_mode is set to TOP
pgms_wait_sampling.query_capture_mode is set to ALL
If I query the query_store.qs_view or pgms_wait_sampling_view data is returned.
SELECT * FROM query_store.qs_view;
SELECT * FROM query_store.pgms_wait_sampling_view;
Also the column qs_view.query_sql_text contains SQL statements, as well as the query_texts_view. Any idea why its not showing up in the UI?

In the portal page of your Azure Database for PostgreSQL server, select Query performance Insight under the Intelligent Performance section of the menu bar. Query Text is no longer supported is shown. However, the query text can still be viewed by connecting to azure_sys and querying 'query_store.query_texts_view'.
https://learn.microsoft.com/en-us/azure/postgresql/concepts-query-performance-insight

Related

Tables are empty in Query Builder when Saved SQL script is retrieved

I saved a query I created in the SQL Developer Query Builder.
When I retrieved the query, the linked Tables don't show the Column Names in the Query Builder.
The Tables are still linked/joined to one another and the query still runs, but the columns names are blank.
How do I get the Column Name to reappear?
I'm new to SQL Developer, so I'm not sure how to resolve this issue.
Any help would be greatly appreciated.
Searched through the menus for something that would restore the columns names.
Searched through help option on SQL Developers and nothing found relating to this issue.
I was very tempted to delete this post when I found the answer myself.
However, I think there are more rookies out there like me.
The resolution is to add a semi-colon ";" to the end of the statement in the Worksheet Tab.
Even though I created the query in the Query Builder Tab, SQL Developer creates the SQL Statement in the Worksheet Tab.
So for some reason after you save that Query that was created in the Query Builder Tab; when you retrieve the script, you must add ";" to the end of the SQL Statement in the Worksheet Tab or else you get the issue I encountered with the blank columns.

Grafana variable section show preview of values although query is wrong

I have a grafana dashboard. In this dashboard i created a variable. The sql query is wrong.
My datasource is : ansdatabase
wrong query : select client from ansdatabase
Right query : select client from clienttable
Strange thing is. When i open variables page and write wrong query and save it. Below page shows preview of values. But there shouldnt be any values there. Also page throws an error that it couldnt find ansdatabase table. It is normal because ansdatabase is not a table name.
You must have done the right query before (select client from clienttable) correct? Grafana keeps the values from the last valid query.

How to display a table of results in Grafana

I have a query (using CloudWatch as a data source) that retrieves a dataset that includes a count of certain event types - fields x, y, z | stats count() by x
the result returned by the query (e.g. if I run the query in log insights):
x | count()
-------------
Foo | 16
Bar | 3
(So the aggregation of stats is run in CW Logs). I want to represent this in Grafana in the same way it is shown above, but when I use the query with a table panel, the results are populated into a drop-down selector, and the table only shows 1 row - e.g. Foo 16 and I need to select which row I want to display in the table.
What is the best way to show all results? I'm not sure whether I should be leaving the stats function off the data query and doing the aggregation / count on Grafana side, or if I am using the wrong panel type / visualation and the query is right (looking on which approach would be best here if both are possible).
thanks in advance.
I encountered this same issue with Grafana 7.0.0.
When parsing an arrayed query response using the Grafana "Table" visualization, the drop-down result selector is a feature of the v7+ versions. The Grafana Explore functions apparently use the older table visualization, which is bundled in V7 versions as "table-old". The table-old visualization should return all query results as rows in the table, without a selector.
It is also possible to click on "Inspect" and then click on the JSON tab.
remove the below field from the JSON:
"statsGroups": [
...
]
NOTE 1: it is sometimes annoying that when editing the panel it is added back automatically
UPDATE
A more clean solution (but sometimes limiting) is to use the "Merge" transformation

* coming in place of keys when connecting saiku with mongo using apache drill

I am using Apache drill in embedded mode and when I am able to connect to mongo and query in drill successfully.
However when I create a schema in saiku schema designer using driver as "org.apache.drill.jdbc.Driver" and URL as "jdbc:drill:drillbit=hostname:31010" the connection is successful and all collections are also fetched and shown as tables in saiku, but in place of column names "*" is coming and actual column names are not coming.
Dont know what I am missing on.
I figured out the solution and posting in case anyone could benefit. I had created a view in drill with select * from table. When I created view as select col1,col2... from table the issue got resolved.

Microsoft Access ADP UPDATE Query does NOT update

I have a (very simple and standard) UPDATE statement which works fine either directly in Query Analyser, or executed as a stored procedure in Query Analyser.
UPDATE A
SET
A.field1 = B.col1
, A.field2 = B.col2
FROM
tblA AS A INNER JOIN tblB AS B
ON A.pk1 = B.pk1 AND A.pk2 = B.pk2
Problem is when i execute the same stored proc via microsoft ADP (by double-clicking on the sproc name or using the Run option), it says "query ran successfully but did not return records" AND does NOT update the records when i inspect the tables directly.
Before anyone even says "syntax of MS-Access is different than SQLServer T-SQL", remember that with ADP everything happens on the server and one is actually passing thru to T-SQL.
Any bright ideas from any ADP gurus out there?
Gotcha. Responding to my own question for the benefit of anyone else.
Tools / Options / Advanced / Client-Server Settings / Default max records is set at 10,000 (presumably this is the default). Change this to 0 for unlimited.
My table had 100,000+ rows and whatever set of 10,000 it was updating was difficult to find ( among a sea of 90,000+ un-updated rows ). Hence the update did not work fully as expected.
Try and see whether the query gets executed on the SQL Server using SQL profiler.
Also, I think you might need to close the linked table & re-open it to see the updated records.
Does that work?
Run the query with SQL PRofiler running. Before you start the trace add in all the error events. This will give you any errors that the SQL Server is generating that the Access ADP might not be showing correctly (or at all).
Feel free to post them here.
Just as a reference, here's a paper I wrote on Update Queries that discusses some of the issues associated with when the fail.
http://www.fmsinc.com/microsoftaccess/query/snytax/update-query.html
I seem to remember that I always got the "didn't return any rows" message and had to simply turn off the messaging. It's because it isn't returning any rows!
as for the other - sometimes there's a primary key issue. Does the table being updated have a primary key in SQLServer? If so, check the view of the table in Access - sometimes that link doesn't come through. It's been a while, so I could be wrong, but I think you may need to look at the design view of the table while in access and add the primary key there.
EDIT: Additional thought:
in your debugging, try throwing in print statements to see what the values of your inputs are. Is it actually picking up the data from the table as you expect when you execute from access?