Questions tagged [cost-based-optimizer]

CBO or Cost-Based-Optimization is a collection of techniques within a RDBMS designed to evaluate numerically how expensive a SQL statement will be. Any SQL statement can be executed in different ways. Each of these ways is a possible execution plan. The CBO will assign to each plan a cost which represents a numeric evaluation of how expensive the operation will be. It will always select the plan with the lowest cost. Lowest cost in this regard logically represents the lowest elapsed time to execute such query.

For a CBO to work properly, statistics are necessary and should be maintained regularly. Oracle , Postgres, MySQL, etc are examples of RDBMS which use the CBO method to evaluate the best way to execute SQL statements.

Use this tag for questions related to execution plans of queries based on the CBO method.

75 questions
1
vote
0 answers

How do I tune a posterior probability threshold value for a binary classifier using more than one performance measure with the mlr package in R?

The following link provided me with a greater understanding of incorporating ordinary cost in my binary classification model: https://mlr.mlr-org.com/articles/tutorial/cost_sensitive_classif.html With a standard classifier, the default threshold is…
Outlier
  • 417
  • 2
  • 10
1
vote
1 answer

How can I print the cost function?

I'd like to ask how to print the cost value when there are two steps in model. Here is my code. ## SE_1st Hidden layer W1 = tf.get_variable("W1", shape=[(2*spl+1)*feature_dim,layer_width_SE],…
JH Kim
  • 33
  • 5
1
vote
0 answers

How is the cost of optimized query plan computed in Spark

I was going the blog published on the Databricks website on Cost based optimizer (CBO) that was introduced in Spark 2.2. It mentions that cost of a query plan is computed based on the formula : cost = weight * cardinality + (1.0 - weight) *…
1
vote
1 answer

Parameter estimates using FME ODE model fitting in R

I have a system of ODE equations that I am trying to fit to generated data, synthetic or lab. The final product I am interested in is the parameter and it's estimated error. We use the R package FME with modCost and modFit. As an example, a system…
Pentaquark
  • 53
  • 5
1
vote
0 answers

GradientDescentOptimizer is giving less accuracy (~0.10) compared to AdamOptimizer(0.95) in convolutional neural net in Tensorflow

I am building a convolutional neural network for classifying MNIST data. I m using 2 conv layer and 2 fully connected layer. import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data def _net_params(): weights = { …
sam48
  • 21
  • 3
1
vote
1 answer

Constraints for Minimizing and their Bounds

I have a little confusion in the optimization model I trying to solve. Its a small model to minimize the cost of two units. I have just started with the optimization and I am not sure if I am interpreting the problem very well into AMPL. Especially…
1
vote
1 answer

Huge nb of parameters, constraint and objective function : how to deal with this in Matlab?

I would like find the Alpha coefficients which minimize this objective function: fun_Obj = @(Alpha) norm(A- sum(Alpha.*B(:,:),2),2) With : A= vector 1d (69X1) B= matrice 2d (69X1000) Alpha_i a vector (1X1000) of unknown parameters, where 0 <…
1
vote
4 answers

Is it better to access several times a value at array[i] or to stock this value in a variable (v=array[i]) and access this variable v instead?

I'd like to know if it costs more to access several times a value at array[i] or to stock the value as a new variable (v=array[i]) and access the variable v several times instead ? for example (in java), would it be better to write : int [] array…
Mireille
  • 11
  • 3
1
vote
1 answer

How to limit BigQuery query size for testing a query sample through the web user-interface?

I would like to know if it is possible to limit the bigquery query size when running a query through the web user-interface? My idea is just to test the query but instead of querying all my tables; I would like just to query a part of it with for…
1
vote
0 answers

Cost comparison optimization calculator code

I have a problem where I need to calculate the best price for a variable price. Basically paper pageCost 1000 pack = .03 per sheet 500 pack = .04 per sheet 100 pack = .055 per sheet Singles = .1 It needs to figure out the best combination for the…
1
vote
0 answers

Cost minimizing algorithm in MATLAB?

I have the following problem that I need to address in MATLAB: I am given an n by n matrix whose sum of elements is always defined to be 1 for all n. I would like to convert my matrix, call it Matrix A, to another Matrix, call it Matrix B, whose…
1
vote
1 answer

After Calculation the gradients of my paramter w and u, what is the next step to optimize them in a SGD way?

What I m coding: I m build an easy neural network with a weight matrix w and a second paramter u for the score. After multipling my input vector with w, the result is multiplied with a vector u to get a result as one figure and that is my…
1
vote
1 answer

Defining size of tables without data (Oracle)

My problem is a little bit complicated, so please bear with me when I try to explain it ^_^. I work on automatically generating several (a big number) DW snowFlake schemas, from a star schema input. In the other hand, i have a set of queries, that…
1
vote
2 answers

How can a node in an execution plan have smaller costs than its child?

I always thought that a node in an execution plan can only be executed after its children have executed, and thus the total cost of a node has to be greater or equal than the cost of the child nodes. However, this is not always the case, like in the…
Karl Bartel
  • 3,244
  • 1
  • 29
  • 28
1
vote
2 answers

Why is 1-norm SVM more sparse than 2-norm SVM?

How are we increasing sparsity by using 1-norm weight in cost function as compared to using 2-norm weight in the same cost function for an SVM. For 1-norm : Cost function- Minimize ||w||_1 For 2-norm : Cost function - Minimize ||w||_2 Is it related…