Questions tagged [optimization]

In the context of a database, optimisation refers to the process of the query optimiser selecting an efficient physical execution plan.

368 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
59 views

Postgres: How to optimize time constrained wildcard search?

I'd like to optimize Postgres response times for a query which looks for select orders.id, orders.created from orders left join order_items on order_items.order_id = orders.id where ...
0
votes
1answer
788 views

optimize big sql query

My query has to return a statistics for example for march containing productname and price and its sidedishes (1:n relation) with the right price of each sidedish and the right tax for each sidedish ...
-1
votes
2answers
62 views

MySQL Select Query not using Required Index

I have a Table which has 2 Million Records and No primary or Unique Keys. I added Two Indexes and I'm expecting an Index to be used for my Select Query. When I saw the Explain Plan , Optimizer is not ...
-1
votes
1answer
596 views

Aggregate function on subquery

I have got a SALES table that has 4 document types, and they are created with reference to each other in the following order: Offer -> Order -> Delivery -> Invoice. For each new row their ...
-1
votes
1answer
101 views

Simple “SELECT” query taking too long

I'm trying to run a SELECT query on our PostgreSQL database using pgAdmin 3. It looks like this: SELECT tstamp AS "time" dvalue AS "Weight" FROM tablename WHERE tstamp BETWEEN 'time1' ...
-1
votes
1answer
225 views

MariaDB query optimizer not using correct index

I got the following query and it was supposed to use index to speed up but it is using the wrong index image_likes and takes around 60 seconds to execute. If I add use index(image_user_id) then it ...
-1
votes
1answer
946 views

How can Mysql server auto re-index tables

I have a table which has very minimal data. However the index_length is very very huge, because of frequent DML operations on this table. Ex : +-----------------------+--------+---------+------------...
-1
votes
1answer
145 views

SQL Server Parallelism Disabled

I came up with a strange issue where the performance of select queries was degraded after creating missing indexes on tables. Initially, it looks like all the queries are affected but when looked into ...
-1
votes
3answers
430 views

MySQL process takes up to 180% of the CPU (optimisation need)

I have a dedicated server with 128 GB of RAM and an 8 core CPU and 2TB hard drive. I have cPanel and MySQL installed in the same server. In this server I have 12 websites hosted including 5 with a ...
-1
votes
1answer
243 views

Optimizing sql query to search in more than 10 million record

I have a SELECT query to search a large table which contains more than 10 million records. I wish to optimize this query for reduce CPU load and get faster response: $query= 'SELECT DISTINCT ...
-1
votes
1answer
589 views

Union function in one function in asynchronous way with postgres

I have several function queries in postgresql. To avoid multiple resquest from the frontend to the server I has grouped all functions in a single funtion like: select * "function_name"() union ...
-1
votes
1answer
596 views

How to reduce the query time on large data table with self inner join in DB2?

I have a table called 'ASSETINFO' in DB2 .This table has 3 MILLION records. I want to fetch the records based on 'Asset Price Range' from the table, so I have applied Inner Join on the same table on ...
-1
votes
1answer
43 views

A test fixture database to experiment on performance tuning?

I would like to learn the basics of database performance tuning, and for myself I learn things faster if I can do hands-on to practise the learning materials. For the performance tuning, it seems ...
-1
votes
2answers
195 views

Optimize query or split in two queries and process result separately?

I have this DB schema: As you may notice already there is no relationship between tables and won't be on the future. If I run the following queries I will get a lot of rows per table: SELECT COUNT(*)...
-1
votes
1answer
101 views

Optimization of a select statement

I'm using MySQL and have a table user_data like this: user_id int(10) unsigned reg_date int(10) unsigned carrier char(1) The reg_data is the unix timestamp of the registration ...
-1
votes
2answers
163 views

Is it possible to optimize this query? Or any recommendations to speed it up?

After looking at my mysql slow log file I see that almost every entry there is related to this query: SELECT n.nid AS nid, AVG(v.value) AS rating FROM node n LEFT OUTER JOIN votingapi_vote ...
-1
votes
3answers
99 views

Looking to improve query performance

This is my query: select S-Num.Title, jobs.JobNum, jobs.JobPart, Part.PartNum, jobs.RevisionNum, jobs.Seq, jobs.Parent, Part.PartDescription, ...
-2
votes
1answer
39 views

How would you do this simple query in the most optimized way MYSQL and also MARIADB

pkid clientname location 1 Jones NY 2 Jones NJ 3 Jones TX 4 Jones FL 5 Jones IA 6 Jones NC 7 Jones SC 8 Jones VA 9 Smith FL 10 Smith CO ...

1
4 5 6 7
8