613 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
36
views
PostgreSQL / TimeScaleDB issue after reimporting a huge set of data [migrated]
I have a PostgresQL 17 DB with a quite simple table (no outer relations) but with a lot of data (around > 446 000 000 records) storing some events on a day basis representing more than 2 years of ...
Advice
0
votes
6
replies
103
views
Why MariaDB doesn't use newly added index?
MariaDB version is 10.4.34.
The query looks like:
SELECT bet.*
FROM Bet bet
WHERE bet.placed >= '2025-10-29T00:00:00'
AND bet.placed <= '2025-10-29T23:59:59'
AND EXISTS (
SELECT 1 FROM ...
3
votes
2
answers
120
views
EXPLAIN CREATE TABLE throws a syntax error at integer type specification - but query runs successfully
EXPLAIN CREATE TABLE TestTbl (
EId integer PRIMARY KEY,
FullName VARCHAR(50) NOT NULL
)
This query results in an error:
ERROR: syntax error at or near "integer"
LINE 2: EId ...
4
votes
2
answers
164
views
Why does the sort method used by Postgres change from "top-N" to "external merge" when FOR UPDATE is added?
I have a table in Postgres (14) that is used like a queue with FOR UPDATE SKIP LOCKED queries. It was missing an index, but since any rows are usually processed quickly that never became a problem. ...
1
vote
1
answer
67
views
force postgresql client to output valid json after EXPLAIN
when in psql:
postgres=# EXPLAIN (ANALYSE, FORMAT JSON) SELECT a FROM t;
QUERY PLAN
-------------------------------------------------------
[ ...
0
votes
1
answer
84
views
What is the meaning of actual rows using explain analyze in mysql
In my sql
explain analyze select
ep1_0.employee_post_id,
ep1_0.access_url,
ep1_0.contact,
ep1_0.contents,
ep1_0.member_id,
ep1_0.payment_amount,
...
1
vote
1
answer
42
views
Optomize query for postgresql with index on jsonb array
I have tables:
request(id: int, current_stage_id: int, selection_id: int)
selection(id: int, settings: jsonb)
Settings has array like {id: int, stage_type: int}.
For example: [{id: 1, stage_type: 2},...
2
votes
1
answer
605
views
Do I trust "cost" or "actual time" more when using Postgres EXPLAIN ANALYZE?
I'm trying to improve the performance of one of our most expensive queries. I'm running EXPLAIN ANALYZE on the sandbox postgres 15 database, which has a much smaller dataset than the production ...
0
votes
0
answers
52
views
Oracle query - strange explain plan behaviour when selecting from view
Having a problem with a long running query (Oracle 11g) . Have narrowed the problem down to a view. This view is fairly complex and too detailed to list.
The problem is on running the select ...
0
votes
1
answer
199
views
MySQL(5.7.26) query optimization, why select * is much faster that select id in my leading wildcard query?
I have a leading wildcard query I know it is hard to optimize. I know if I use only the trailing wildcard I can do some optimization. But our client wants the leading wildcard because when searching ...
1
vote
0
answers
43
views
postgresql EXPLAIN gives seq scan rows = 12 for filter id < 10
I ran explain command on this query:
EXPLAIN
Select * from project_project where id < 10 FOR UPDATE
And the plan output:
"LockRows (cost=0.00..6.57 rows=12 width=18305)"
" -> ...
0
votes
2
answers
105
views
postgresql query taking 3 min to execute ,how can i reduce the time to within 60 seconds
I need help optimize below postgresql query.
Currently its taking more than 3 min to get the data , due to that my API got timeout ,can you please help me to get the result set within 59 seconds.
...
0
votes
3
answers
64
views
How do i return an array to display from backwards
hey so am new in java and haven't gotten in my head the logic on how to print an array backwards. I just don't understand how it flows using forloop
its fairly easy and chatgpt could easily do it ...
2
votes
1
answer
56
views
Why query do not use keys corectly?
I have this complicated query:
SELECT * FROM `s`
LEFT JOIN `users` AS `iu` ON iu.user_id = s.s_iu_id
LEFT JOIN `users` AS `uu` ON uu.user_id = s.uu_id
LEFT JOIN `sic` ON sic.s_id = s.s_id
LEFT ...
1
vote
1
answer
283
views
What does Type "ref|filter" mean in mariaDB Explain Output
Trying to troubleshoot a MariaDB query. We did an explain select on the select. A couple of the rows in the output have value ref|filter for the type column.
What does this mean? The MariaDB docs ...