All Questions
Tagged with query-optimization database-performance
346 questions
0
votes
0
answers
46
views
Evaluate the memory usage of a View being used to populate an AAS table
I need help evaluating the actual execution plan of an SQL Server View:
https://www.brentozar.com/pastetheplan/?id=zAFOrTkUxr
Context
The above View is being called by Azure Data Factory to populate a ...
2
votes
0
answers
23
views
How to improve GridDB Memory Usage for Long-Running Queries?
I am using GridDB CE to handle time-series data and run long-running analytical queries. During these queries, I observe significant memory usage spikes that degrade performance or lead to errors. ...
0
votes
1
answer
57
views
Need help understanding why Spark query takes longer to execute when GROUP BY is introduced
I have 3 tables in an Oracle database which I am trying to join and run some aggregates on :
orders: (3000 + rows)
order_line_items: (5000 + rows)
items: (14 million rows)
When I run the following ...
1
vote
2
answers
107
views
Why does having a DISTINCT in an outer query increase query time by 30000x when subqueries are present?
(Using SQLite v3.35.5)
Consider this query (don't worry about the specifics -- it's just a DISTINCT select with two subqueries to get counts):
SELECT DISTINCT name,
(SELECT COUNT(name) FROM ...
1
vote
2
answers
233
views
How to Optimize Search Queries on a Large PostgreSQL Table without Compound Indexes?
I have a PostgreSQL table named users which contains between 20 to 30 million records. The table has the following columns: id, tenant_id, name, company, location, and description.
I need to perform ...
0
votes
0
answers
88
views
SQL query get slower and slower while load testing
I'm currently loading a Spring Boot application with Spring Data JPA which connected to a PostgreSQL database. There is a Rest API to get sample details for a given time period. That API is working ...
0
votes
1
answer
30
views
Filtering rows While Joining Two Tables(dataframes)
Currently I have 2 tables, lets say symbol_data and cve_data.
symbol_data is structured as below:
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 ...
1
vote
1
answer
71
views
Performance issues with recursive SQL Server stored procedure for hierarchical data
I have a stored procedure GetCombinedRequestInfosByEmail that retrieves hierarchical data for employees. The procedure performs well for lower-level employees but takes around 55 seconds to execute ...
2
votes
1
answer
253
views
MySQL Database Performance Decimated After Server Migration
I have a CRM that I've built over the past couple of years that has been working fine. The database is MySQL, and the front end is a web interface. This week, we 'upgraded' our hosting plan from a ...
1
vote
2
answers
617
views
MySQL Query result Fetch Time is way beyond than Execution Time, how to Solve this?
I am using MySQL 8.0.27-18, with InnoDB as engine. I have a huge database, with few tables containing 100M+ rows in them. For example: TABLE_A with 110M and TABLE_B with 300M+ rows. Sometimes I had to ...
1
vote
1
answer
25
views
Custom search query for many-to-many related tables optimization
I have two tables that are related by a many-to-many relation. Now, I want to retrieve results from table 1, where the rows in table 1 are related to specific criteria in a column in table 2.
For ...
1
vote
1
answer
133
views
This query is slow because I think I'm using a lot of id values in the ANY() clause, isn't it?
I have this table in Postgres:
CREATE TABLE public.products
(
id character varying NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
name character varying ...
0
votes
1
answer
63
views
Dynamically create tables by foreign key
I am developing an application that records the values of several probes and I am wondering about storing these values in our DBMS.
The traditional way would be to create a table like this:
CREATE ...
3
votes
1
answer
930
views
Vastly different query performance on GIN indexed table using different search words
Problem
Text searches in a Postgres table with a simple GIN index ordered by creation timestamp have wildly different latencies based on the keyword that is being searched. While searches for frequent ...
2
votes
1
answer
453
views
Why is it more efficient to create a new table instead of altering a column?
I have a table with an integer primary key that needs to be changed to a bigint.
Thanks to other answers I found multiple solutions for this problem.
But when I compared their speed I found the result ...