Questions tagged [database-tuning]

deals with optimizing the performance of a database. It can be about file design, and selection of the DBMS, OS and platform.

Database tuning is about maximizing the performance of a database. It can include hardware, software, file system, OS and DBMS selection. See the wikipedia article for more.

158 questions
0
votes
2 answers

Why does the optimizer choose a keylookup instead of 2 separate queries?

I have a table that has a primary key/clustered index on an ID column and a nonclustered index on a system date column. If I query all the columns from the table using the system date column (covering index wouldn't make sense here) the execution…
0
votes
1 answer

redshift optimization: reduce i/o skew, or stick with dist key used in joins?

Generally speaking, when there is a table whose dist key results in a high degree of I/O skew but is also used in join operations between that table and others (which are also distributed using the same key), is it better to choose a different dist…
jph
  • 2,181
  • 3
  • 30
  • 55
0
votes
0 answers

Unexpected query statistics when running multiple consecutive statements

Using SQL Server 2016 and later I am currently evaluating two methods of displaying search results. Display all "products" that match a "criteria". I was looking into the merits of storing the list of IDs that match the criteria in a temp table…
Matthew Baker
  • 2,637
  • 4
  • 24
  • 49
0
votes
1 answer

Change the Table-Value Function to Inline from Multi-line

I'm trying to change a Table-Valued Function to improve the performance of a Stored Procedure but I can't get the same result. Can you tell me where I'm going wrong? Original: create FUNCTION [dbo].[fun_eess1] ( @institucion int , @disa int, @red…
0
votes
0 answers

Choosing Index on table

My table have 10 columns but i will use 5 columns more frequent. which is the better way to create an index like do we have to create index in all the 5 columns or composite index do we have to create. Actually performance is main thing to…
0
votes
2 answers

MariaDB Crash Reason

I have recently migrated a small data warehouse from a 32-bit windows MySQL 5.5 instance to a much larger MariaDB instance. Overall, the performance improvements have been as expected. However, I am running in to scenarios where the database server…
Justin
  • 474
  • 4
  • 14
0
votes
0 answers

Run mysqltuner.pl against azure database for MySQL service

I would like to run mysqltuner from my pc on a remote host. The remote host is a MySQL database hosted on Azure (Azure Database service for MySQL). I dont have access to the virtual machine - just have credentials to connect to the database. perl…
sokolata
  • 491
  • 3
  • 7
  • 21
0
votes
1 answer

DbContext SaveChanges - System.Data.SqlClient.SqlException: Execution Timeout Expired

I have this happening from time to time on my Production application. My scenario is a simple one, as follows: using (var ctx = new MyDbContext()) { ctx.SMSReplies.Add(new SMSReply { //Set properties here }); …
Shawn de Wet
  • 5,642
  • 6
  • 57
  • 88
0
votes
1 answer

Oracle - filter on analytical function is making the query slow

-------------------------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time …
swet
  • 207
  • 4
  • 15
0
votes
0 answers

PostgreSQL - long query just halts

I have a materialized view based on a very complex (and not very efficient) query. This materialized view is used for BI/visualization. It often takes ~4 minutes to complete the refresh, which is good enough for my needs. Running ANALYZE shows total…
aei
  • 250
  • 1
  • 2
  • 11
0
votes
1 answer

How to increase performance by declaring Cursor on need basis in PL SQL?

I have the below code with 2 cursors. Both are time consuming ones even after required tuning. So, my idea is to increase performace of the function by invoking the cursor SQL only on need basis based on some known condition. Existing code…
user2488578
  • 896
  • 4
  • 21
  • 40
0
votes
0 answers

Oracle : Same Query taking different time on two different machine

I have oracle database schema on my local machine and same schema is present on server machine as well, but time taken to execute same Query by: Server Machine : 17.45 Seconds Local Machine : 3.05 Seconds P.S : Server configuration is far much…
0
votes
1 answer

Not able to get performance even after creating composite as well as simple indexes(regular and Bit map) as well

I am working on a query optimization task and i have a set of queries which are being used by my application and supports all (Oracle, Ms Sql Server and MySql) databases. My table structure: User_Info { id int primary key user_name …
0
votes
1 answer

Analyze Table Syntax Error

The following sql statement raises a syntax error: analyze table my_table sample_size 0; This is the raised error: Syntax error in SQL statement "ANALYZE TABLE MY_TABLE SAMPLE_SIZE[*] 0 "; expected "integer"; The official documentation gives the…
Stephan
  • 41,764
  • 65
  • 238
  • 329
0
votes
1 answer

postgres windows efficient memory usage

I'm using Postgres 9.6 (64 bit) on Windows 10 on a laptop with 8 GB RAM for dev purposes. The application is batch mass data processing with the large table having 10 mio records. I've read various Postgres tuning guide, and also previous…
Juergen
  • 699
  • 7
  • 20