The sql-optimization tag has no wiki summary.
3
votes
2answers
22 views
Are Columns Not Selected in SQL Views Executed?
I wasn't able to come up with the right keywords to search for the answer for this, so apologies if it was answered already.
Consider the following SQL view:
CREATE VIEW View1 AS
SELECT Column1
...
0
votes
4answers
49 views
Optimizing tricky SQL search query
I am trying to come up with a simple, performant query for the following problem:
Let's say there are several entities (items) which all have a unique ID. The entities have a variable set of ...
0
votes
1answer
33 views
MySQL: efficiently converting event logs to time series
I have a table recording the start time and end time of events of interest:
CREATE TABLE event_log (start_time DATETIME, end_time DATETIME);
INSERT INTO event_log VALUES ("2013-06-03 ...
1
vote
2answers
45 views
MySQL not using multiple column index
I have query with columns in where clause which are part of primary key and have foreign key indexes on all columns.
EXPLAIN SELECT aggEI.c_id AS companyId, aggEI.ei_uid AS uuid
FROM AGG_EI AS ...
1
vote
3answers
96 views
@ Symbol - a solution for Recursive SELECT query in Mysql?
there are a lot of questions about Recursive SELECT query in Mysql, but most of answers is that "There NO solution for Recursive SELECT query in Mysql".
Actually there is a certain solution & I ...
1
vote
2answers
65 views
SQL: How to select one record per day, assuming that each day contain more than 1 value MySQL
I want to select records from '2013-04-01 00:00:00' to 'today' but, each day has lot of value, because they are saving each 15 minutes a value, so I want only the first or last value from each day.
...
1
vote
2answers
20 views
Not efficient execution plan taken by MySQL InnoDB
I have trouble to optimize a request with the MySQL InnoDB optimizer.
The following query (query 1) runs efficiently:
explain select * from ah_problems
where rnid in (6022342, 6256614, 5842714, ...
1
vote
1answer
54 views
Nested GROUP BY optimization
I have the following query:
SELECT trip_id, MAX(cnt) FROM
(
SELECT trip_id, stop_id, COUNT(*) as cnt
FROM operation_ticket_part_stops
GROUP BY trip_id, stop_id
) AS t
GROUP BY trip_id
...
0
votes
1answer
71 views
Advices/tips on optimizing an Oracle SQL query executing on significant volumes
Don't run just after seeing the Oracle SQL query below ! :)
I put the complete query in ordrer to ask for some advices on optimizations.
I used the Oracle explain plan tool to help me identify some ...
5
votes
1answer
87 views
MySQL query optimization: how to optimize voting calculations?
Hope you're doing fine.
I need a help a bit with this database:
This is a database that stores votes. Users pick the audio tracks they like, and they vote for them. They can vote 'up' or 'down'. ...
3
votes
4answers
94 views
SQL - Too many calls to subquery
The below query is fairly slow, in terms of the subquery selection for the "skill name". When I run a profile against the SQL execution I am getting far too many queries per line from the ...
1
vote
2answers
133 views
mysql peformance INSERT into table SELECT for report
I am working on a mysql query for a report. The idea is to have a simple table say 'reportTable' with the values being fetched from various places. I could then use the reportTable more easily ...
0
votes
0answers
120 views
How to Speed Up MySQL Group By Query Within Date Range [closed]
Am having trouble reducing response time on a query we were hoping to provide for a customer-facing web application. The table structure is as so:
delimiter $$
CREATE TABLE `test_table` (
...
0
votes
2answers
59 views
Does setting MaxDOP on Database level restrict CPUs for that DB or for Queries ran in that DB?
We have a CPU with 16 cores. The CPU is used only for SQL server with a single database. Currently, MaxDOP is set to 0.
We were considering changing the MAXDOP to 8 in an attempt to limit the max ...
2
votes
4answers
125 views
Sqlite database optimization
I have a sqlite3 database with three tables:
CREATE TABLE document (
id Int PRIMARY KEY NOT NULL,
root_id Int,
name Varchar(100),
active Tinyint
);
CREATE INDEX IDX_documentId ON document ...