Questions tagged [sql-query-store]

SQL Server Query store introduced in SQL Server 2016 stores multiple query plans per query. This information gathered over time is helpful in troubleshooting performance issues for a query over time, unlike procedural cache which stores only last plan. Please use this tag if you are using SQLAzure or versions greater than SQLServer 2016

Common scenarios for using the Query Store feature are:

  • Quickly find and fix a plan performance regression by forcing the previous query plan. Fix queries that have recently regressed in performance due to execution plan changes.
  • Determine the number of times a query was executed in a given time window, assisting a DBA in troubleshooting performance resource problems.
  • Identify top n queries (by execution time, memory consumption, etc.) in the past x hours.
  • Audit the history of query plans for a given query.
  • Analyze the resource (CPU, I/O and Memory) usage patterns for a particular database.
155 questions
1
vote
1 answer

How to write a SQL query in CosmosDB for a JSON document which has nested/multiple array

I need to write a SQL query in the CosmosDB query editor, that will fetch results from JSON documents stored in Collection, as per my requirement shown below The example JSON { "id": "abcdabcd-1234-1234-1234-abcdabcdabcd", "source": "Example", …
1
vote
2 answers

TO find out same student is associated with how many subjects in different group

I have below Table, Need to exract those records where Same Value is associated with more than one different GroupId. If the same value is being duplicated under same GroupId then don't need to fetch that. GroupId Value 11 AAA 11 AAA 11 …
Janny
  • 25
  • 7
1
vote
1 answer

retrieve multiple data value from different tables using JOIN

I have three table. 1. bni_category 2. bni_chapter 3. bni_member CREATE TABLE `bni_category` ( `bni_category_id` int(11) NOT NULL, `bni_category_name` text, `is_active` int(1) NOT NULL DEFAULT '1', `is_delete` int(1) NOT NULL DEFAULT '0', …
Meet Patel
  • 59
  • 7
1
vote
2 answers

SQLQuery for Time In and Time Out attendance in Oracle

I have a table in oracle with the below sample output. EID | type | Date 24 | IN |03/25/2019 6:45 am 24 | OUT |03/25/2019 8:05 am 24 | IN |03/25/2019 8:06 am 24 | IN |03/25/2019 8:28 am 24 | OUT |03/25/2019 9:48…
1
vote
3 answers

MySQL- Improvement on count(*) aggregation with composite index keys

I have a table with the following structure with almost 120000 rows, desc user_group_report +------------------+----------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra…
Coder 477
  • 405
  • 2
  • 6
  • 16
1
vote
2 answers

SQL writing custom query

I need to write a SQL Query which generates the name of the most popular story for each user (according to total reading counts). Here is some sample data: story_name | user | age | reading_counts -----------|-------|-----|--------------- story 1…
Klaidi Ziaj
  • 115
  • 2
  • 9
1
vote
2 answers

sql query with multiple headers and multiple counts

I have a table with client task details (attached picture). I want result like number of tasks received for a particular month for each client, no. of tasks completed within 5days from the start date and its compliance. could someone help with a SQL…
1
vote
1 answer

SQL Server Query Store's Total Duration Value Seems High

I've been looking at SQL Server's Query Store, specifically at the overall resource consumption view. It has a "total duration" field. I put a 60 minute workload on the server and this field is reporting 25 hours of duration. Is this being tracked…
1
vote
1 answer

Query Store does not record any data

I have enabled the Query Store for two of my databases (acceptance and production), which are both running on the same instance of SQL Server 2016 Standard Edition. The Query Store records query history on the acceptance database, but on the…
1
vote
1 answer

How to fetch the data for multiple values Categorywise using mysqli and PHP

I am creating a simple database. I have a categories table which looks like this: CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `category_name` varchar(256) NOT NULL, PRIMARY KEY (`id`) )ENGINE=MyISAM …
Chitra Nandpal
  • 363
  • 1
  • 19
1
vote
1 answer

SQL Server Query Store: [sys.query_store_query_text].[query_sql_text] is truncated?

I'm working with the following query against the Query Store: SELECT TOP 100 qp.last_execution_time [qp__last_execution_time], qt.query_sql_text, len(qt.query_sql_text) sql_length, round(rs.avg_duration ,5) avg_duration …
tbone
  • 5,397
  • 18
  • 79
  • 121
1
vote
2 answers

Big query SQL Error: Column name user_dim is ambiguous at [3:3]

how can i run a query that goes through both my android and iOS data to return what i need in one table. currently getting the above error when i run this #standardSQL SELECT user_dim.app_info.app_instance_id, …
1
vote
3 answers

Sql query with three conditions

I have a database with a table having content as below : message_number message_type message_chat 0 IN Hi 1 OB Hello 2 IN Help 3 IN …
Srijan Sharma
  • 503
  • 5
  • 15
1
vote
1 answer

Cannot enable Query Store on SQL Azure database

One of our Azure SQL databases ran out of space recently which I believe resulted in Query Store switching over to "READ_ONLY". I increased the size of the database however this has not resulted in the status changing even though running this…
Andy Sinclair
  • 1,843
  • 14
  • 17
1
vote
3 answers

SQL Query with a Condition between 2 Tables

I'm trying to: 1) Find whether 1 object contains the same Username and Password that I have inputted, in Table 1 2) IF there is an object that contains the same Username and Password then 3) Carry out an INSERT statement inside Table 2. So far the…
1 2
3
10 11