New answers tagged

0 votes

What index can be created to optimise this query?

The cause of the problem is the following: The optimizer thinks that there are enough rows in changes that are related to a user_items row with the correct user_id that it can quickly find 100 results ...
Laurenz Albe's user avatar
  • 51.6k
0 votes

What index can be created to optimise this query?

you shold rewrite your query to SELECT "id", c."item_id", "item_name", "type", "updated_time", "counter" FROM "changes" c JOIN (...
nbk's user avatar
  • 8,232
0 votes

What index can be created to optimise this query?

It looks like the following indexes would work for you. The idea is to add first the equality predicates, then the join/sorting/inequality predicates, then add other columns as INCLUDE. changes (type, ...
Charlieface's user avatar
  • 12.8k
0 votes

How do you eliminate extra transaction log files?

Backup transaction log backup log yourDatabase to disk='C:\yourDatabase_logbackup.trn' Remove file alter database yourDatabase remove file secondary_logfile_logical_name; https://learn.microsoft.com/...
SergeyA's user avatar
  • 474
1 vote
Accepted

Slow query when using OR clause

Many issues. Hard to blame a single one. There is a trigram GIN index on news.text, but your query cannot use it, because text is hidden behind a non-sargable expression. The table has only 7000 rows, ...
Erwin Brandstetter's user avatar

Top 50 recent answers are included