Questions tagged [query-tuning]

123 questions
2
votes
4 answers

Join statement performance in SQL

I'm working on SQL Server 2008-R2 and I need to use multiple tables join. In that case, which query has better time performance, when using the WHERE statement or using INNER JOIN with ON statement ? both statements using the AND operator for multi…
2
votes
2 answers

Date Parameter causing Clustered Index Scan

I have the following query DECLARE @StartDate DATE = '2017-09-22' DECLARE @EndDate DATE = '2017-09-23' SELECT a.col1, a.col2, b.col1, b.col2, b.col3, a.col3 FROM TableA a JOIN TableB b ON…
SE1986
  • 2,534
  • 1
  • 10
  • 29
2
votes
2 answers

Tuning a query to parse XML data on SQL Server 2014

I have a table on a SQL Server 2014 database that stores auditing information for record changes in a VARCHAR(MAX) column (poor man's CDC.) This data is in following format: Assigned To changed from
Chahk
  • 75
  • 7
2
votes
2 answers

Query Tuning Bigquery

I have a query with a strange behavior because in certain occasions it takes 120 seconds and another 250 seconds. I have to minimize execution time but can not find a guide to help me to improve the runtime of my queries. The table containing the…
2
votes
1 answer

Optimizing huge value list in Teradata without volatile tables

Have a value list like` `where a.c1 in ( list ) ` Then shoving the list in the volatile table is the best way out. However this is being done via cognos & IBM isn't smart enough to know what Teradata's volatile table is. I wish It was so I could…
user1874594
  • 2,277
  • 1
  • 25
  • 49
2
votes
0 answers

Retrieve SET STATISTICS PROFILE ON programmatically in SSMS for further analysis

When executing T-SQL queries via Management Studio, I can use SET STATISTICS PROFILE ON to capture statistics and query execution plan in a nice-looking format as a text. How can I gather the query execution plan after I execute stored procedures,…
Stas Prihod'co
  • 864
  • 9
  • 13
2
votes
1 answer

Optimizing queries for the particular table

I have a table and I'm looking for a way to improve its performance. Below there is a list of queries to be executed. dbo.CustomersSmallOrders ( ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY CLUSTERED, CustomerName VARCHAR(MAX) NOT NULL, …
2
votes
2 answers

Optimizing String search in oracle

I have a view that contain all data related to employee. it had about 350k records. I have to make a name search functionality. That will retrieve all the data that matches the keyword entered. The query performance is very slow it takes 15-20…
ThePallav_Abhi
  • 119
  • 1
  • 1
  • 7
2
votes
2 answers

Data Calculations MySQL vs Python

I'm trying to understand which of the following is a better option: Data calculation using Python from the output of a MySQL query. Perform the calculations in the query itself. For example, the query returns 20 rows with 10 columns. In Python, I…
Ravi
  • 2,472
  • 3
  • 20
  • 26
1
vote
3 answers

How does Oracle calculate the cost in an explain plan?

Can anyone explain how the cost is evaluated in an Oracle explain plan? Is there any specific algorithm to determine the cost of the query? For example: full table scans have higher cost, index scan lower... How does Oracle evaluate the cases for …
Gaurav Soni
  • 6,278
  • 9
  • 52
  • 72
1
vote
3 answers

Need help optimizing MySQL query with joins

I'm still having problems understanding how to read, understand and optimize MySQL explain. I know to create indices on orderby columns but that's about it. Therefore I am hoping you can help me tune this query: EXPLAIN SELECT specie.id,…
Fer
  • 4,116
  • 16
  • 59
  • 102
1
vote
2 answers

Optimize very slow Mysql Query

I need help optimizing this query: SELECT c.rut, c.nombre, c.apellido, c.estado, c.porcentajeavance, c.porcentajenota, c.nota, c.curso, c.fecha_inicio, c.fecha_termino, c.grupo, c.fecha, c.cargo FROM tbl_historico c WHERE fecha =…
mbarrerar
  • 43
  • 4
1
vote
2 answers

Cost of a query in/dependent of amount of data

Could you please tell me whether the cost of a query is dependent on the amount of data available in the database at that time? means, does the cost varies with the variation in the amount of data? Thanks, Savitha
Savitha
  • 405
  • 4
  • 15
  • 25
1
vote
2 answers

Best way of benchmarking INSERTs - all inclusive?

If I would like to benchmark how different table definitions affect row insertion speed in SQL Server, I guess it's not sufficient to just time transaction from BEGIN to COMMIT: this only measures the time spend to append INSERTs to the (sequential)…
someName
  • 1,275
  • 2
  • 14
  • 33
1
vote
1 answer

Need suggestion for POSTGRES Tuning

I am in a need to run the few complicated queries frequently on my database, one of my queries is taking around 57 sec to execute, I am trying a way to tune my Postgres database, so, I can cut the execution time to half or more than that. I have…
1
2
3
8 9