New answers tagged

5 votes

Stored Procedure Tuning Help

The Potential Problem At a quick glance at the execution plan and what the code is doing, it looks like one of the main issues is your JOIN clause to [maxims_prod].[dbo].core_patient_c_identifi: LEFT ...
  • 30.4k
0 votes

Is a performance improvement for this query with subselect possible?

There is a way to solve this with a single logical hit on the table, keeping the OR condition though. It may or may not work faster. The solution requires MySQL 8+ as it uses a CTE and the ...
  • 22.3k
2 votes
Accepted

Is a performance improvement for this query with subselect possible?

Two problematic constructs: OR and NOT IN ( SELECT ... ). This addresses both: ( SELECT * FROM fruits WHERE customer_id = 1 ) UNION ALL ( SELECT * FROM ...
  • 73.8k
3 votes
Accepted

Does a select within a where clause affect performance?

No, the same principle doesn't apply in the example you gave. The optimizer will generally try to convert that type of predicate against a derived table into a set-based construct like a JOIN or ...
  • 28.5k
0 votes

Why is MariaDB innodb_flush_method = O_DIRECT so much slower than fsync for SELECT count(*) as count?

(Not an Answer, but too long for a Comment.) What filesystem? ZFS, EXT, etc? Does it have "journalling"? Set innodb_buffer_pool_size to about 70% of RAM (say, 40G). 128M is ridiculously ...
  • 73.8k

Top 50 recent answers are included