Questions tagged [optimizer-hints]

36 questions
36
votes
4 answers

Does GCC inline C++ functions without the 'inline' keyword?

Does GCC, when compiling C++ code, ever try to optimize for speed by choosing to inline functions that are not marked with the inline keyword?
Carl Seleborg
  • 13,125
  • 11
  • 58
  • 70
13
votes
2 answers

What can happen as a result of using (nolock) on every SELECT in SQL Server?

I get that the (nolock) optimizer hint allows for "dirty reads", but under what very specific scenarios is this a bad idea? I've never seen such widespread use of (nolock) in an organization, and it makes me nervous. I'd like an explanation in terms…
Chris McCall
  • 10,317
  • 8
  • 49
  • 80
4
votes
0 answers

How to use rowlock and readpast with NHibernate?

I have an application which currently reads data from a table using the following stored procedure: CREATE PROCEDURE [dbo].[GetBatchOfEmails] @BatchSize INT AS BEGIN SET NOCOUNT ON; WITH ResultSet AS ( SELECT TOP(@BatchSize)…
Øyvind
  • 1,600
  • 1
  • 14
  • 33
4
votes
2 answers

Oracle optimizer hints xmlagg function

I have a function which calls several tables / views etc. with a few xmlaggs of the data. For some reason I am getting a performance increase when I am pulling in additional information even though this extra information isn't used for the rest of…
bob dylan
  • 1,458
  • 1
  • 14
  • 32
3
votes
2 answers

How to compile and start VSC++ Projects Faster?

What techniques do you use to compile and start VSC++ projects fast? For us, especially the loading of all the dlls take a long time. Is there a way to speed this up? The project loads a ton of .dlls and some of them are especially slow. Now that we…
Tony
  • 417
  • 4
  • 11
3
votes
1 answer

Stored procedures and OPTIMIZE FOR UNKNOWN

I've read up on the SQL Server 2008 OPTIMIZE FOR UNKNOWN query hint. I understand how it works. However, I have a question on where and when to use it. It cannot be specified inside a UDF. It can be specified inside a stored proc. However, this MSDN…
IamIC
  • 17,747
  • 20
  • 91
  • 154
3
votes
0 answers

Indexes hints in a Subquery

I have a SQL statement that has performance issues. Adding the following index and a SQL hint to use the index improves the performance 10 fold but I do not understand why. BUS_ID is part of the primary key(T1.REF is the other part fo the key) and…
Medu
  • 135
  • 2
  • 10
3
votes
2 answers

How do I force access by index rowid in Oracle?

I need help forcing Oracle to always use table access by index row id on table "r_rapport" (~60k rows) to subsequently avoid full table scans on "r_attributfeld" (~8m rows) . I have a query resulting in the following…
Thaylon
  • 453
  • 5
  • 12
3
votes
2 answers

Parallel Execution of Procedures in SQL Statement (Oracle 11g)

I have a SQL-Statement which uses a Check-Function which takes a quite long time for execution. Now I want to Parallize the execution of the Check-Function, but it does not work. Where is the mistake I made? The sample below takes 5 Seconds to…
2
votes
2 answers

Optimizing simple search script in PowerShell

I need to create a script to search through just below a million files of text, code, etc. to find matches and then output all hits on a particular string pattern to a CSV file. So far I made this; $location = 'C:\Work*' $arr = "foo", "bar" #Where…
cc0
  • 1,960
  • 7
  • 40
  • 57
2
votes
3 answers

__builtin_expect from GCC with probability

__builtin_expect from GCC can be used by programmer to show which variants are expected to be very often and which are rare. But __builtin_expect have only "true" and "false" (0% or 100% probability) For some big projects it is vary hard to get…
osgx
  • 90,338
  • 53
  • 357
  • 513
2
votes
1 answer

Oracle 11g INDEX_SS Hint

Given a table with columns A, B, and C of type CHAR(15) and an unique index If I have a query with a WHERE clause specifying A and C, oracle's optimizer chooses to do an index range scan. But if I know that the cardinality of B is low, should I…
Tony Meng
  • 353
  • 4
  • 12
2
votes
2 answers

Convincing the Oracle SQL optimizer that an indexed (though non-UNIQUE) column actually contains unique values in practice

I am writing a view that uses a column with a non-UNIQUE index on it. However, within the context of my view, I am confident that the column will only contain unique values (due to the conditions imposed in the WHERE clause). The real problem…
Adam Paynter
  • 46,244
  • 33
  • 149
  • 164
1
vote
1 answer

What is the best way to fix a Oracle Query performance in production? Changing application code? Using plan baseline?

Let's assume there is a C++ application executing a specific SQL query on Oracle database. This query was working fine for last couple of years in production at a customer's environment, but suddenly one fine day the query started taking around 10x…
Jackie
  • 11
  • 1
1
vote
1 answer

Is there a way to monitor optimizer's step in Pytorch?

Consider that you are using a Pytorch optimizer such as torch.optim.Adam(model_parameters). So in your training loop you will have something like: optimizer = torch.optim.Adam(model_parameters) # put the training loop…
White
  • 305
  • 2
  • 11
1
2 3