8,254 questions
0
votes
0
answers
10
views
Performance issue while processing millions of rows in PostgreSQL
Consider there is table of URLs where there are millions of records stored.
Our requirement is to retrieve number of URLs for a particular domain. For example, if we have a domain url of wordpress.com,...
0
votes
0
answers
37
views
Optimizing sql query [closed]
I need to write an SQL script for a denormalized data mart. However, I'm facing query optimization issues because the current SQL query doesn't execute (or executes too slowly)
This is My SQL- Query ...
2
votes
0
answers
46
views
PostgreSQL Choosing Full Index Over Partial Index
I am using PostgreSQL 17.2 and working with the postgres_air Database.
I have a very simple query:
SELECT status
FROM postgres_air.flight
WHERE status = 'Canceled';
And the following indexes:
CREATE ...
0
votes
0
answers
10
views
Parse spark execution plan to find predicates and realted base tables [closed]
Is there any tool to parse spark execution plan to find out the predicates used in the queries and find the base tables on which the predicates are filtering.
1
vote
1
answer
46
views
How to use index to search if trim is used in search value
My Postgres 17 database has a large table with 245 columns containing an indexed column ribakood:
CREATE TABLE firma2.toode
(
...
ribakood character(20) COLLATE pg_catalog."default",
...
...
-1
votes
1
answer
39
views
Nested Loop Join - How to resolve [closed]
I have a query that is continually running extremely slowly due to a nested loop join. I am joining a table of customer data to a calendar table that contains dates, week, quarter and year values. The ...
-1
votes
0
answers
74
views
Postgres query optimization partial indexes [closed]
I am querying news database (postgres + pg_vector) and want it to be fast. Due to being news database I am interested only in last day queries and new data comes in all the time.
I have some basic ...
0
votes
0
answers
42
views
why using curdate in mysql takes longer than using between [duplicate]
I have query mysql like this
SELECT outpatients.OutpatientID AS ID, FLOOR((CURDATE() - patients.DateOfBirth)/10000) AS age,
from outpatients
LEFT JOIN patients ON outpatients.PatientID = patients....
1
vote
3
answers
140
views
SQL Server select query where clause
Evaluating one side of OR in my query. I have a SQL Server query with 2 separate complex filters. The intention to combine them in one as follows:
Declare @BoolSet Bit = 0
Select Distinct Top (1200)
...
0
votes
0
answers
32
views
How to optimize a Starburst/Presto query that joins on two different keys without reading the same table twice?
I'm using Starburst (Presto) to query a large trip dataset (trip_data) from S3. I have a list of users (user_id) coming from a Kafka table (kafka_table), and I want to join this with trip data from ...
-1
votes
4
answers
56
views
Does PostgreSQL optimize the data transfer for cross product results?
Background: I'm using Doctrine ORM with a PostgreSQL database. To eliminate an N+1 problem I had to add a lot of left joins to my query.
Which results me in joining a very small result set with a very ...
0
votes
1
answer
62
views
Azure SQL SELECT columns INTO #Temp table very slow
Azure SQL SELECT of columns INTO #Temp table is executing very slowly. If I remove the INTO clause, it executes in 20 seconds instead on 10 minutes.
Kindly suggest, how do I optimize this query? ...
0
votes
0
answers
76
views
Very slow query on TimescaleDB when retrieving latest values
I am testing a Timescale DB for a migration, and there is a query which is very slow depending on the time range, when using m.ts >= '2019-07-03 11:50:00+00' the query takes 1m30s (!), but with m....
-1
votes
1
answer
19
views
MariaDB 10.3 Semijoin very slow with large table and IN queries [closed]
I am using MariaDB server 10.3 and queries with large IN (1000 values) on a large table were very slow (10 minutes) compare to the same database running on mysql 5.5 engine(0.5sec).
1
vote
0
answers
56
views
Why would SQL Server not use a Merge Join (Concatenation) operator on non-unique, but pre-sorted values? [migrated]
I have a very simple query where I use a UNION ALL + ORDER BY over two queries that return pre-sorted data from respective indexes. For some reason, SQL will not use a Merge Join (Concatenation) for ...