473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

cost of an SQL Query

Hi,

I need an answer in SQL. Can anyone please explain me what is meant by Cost of an SQL Query? Where does we use this and what is the use of this technology?
Oct 2 '06 #1
3 11099
I don't think that we're taking about a technology.

And the direct answer I could give you I that The cost of an SQL Query is the amount of time and resources that X query will use at a given machine. I.E. The cost of executing a simple query like:

select * from a_table;

Would depend on the size of that table. Could be from .000000000001 seconds to say, 3 or 4 minutes. And The query could block the access to the database in the meanwhile.

As a rule of thumb try to restrict your queries as much as you can.

select <specific_fields> from <table> where <max_restrictions>
Oct 2 '06 #2
How do I calculate the (full) Cost of a query?
Nov 1 '06 #3
1) select cost (choose) based optimisation.
2) Analyse the corresponding tables.(user alter statements)
3) Generate explain plan for the sql (set autotrace or explain plan for the statement)
4) Analyse with the trace file generated.

Refer asktom to view brief of all the steps.
Nov 3 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Dan | last post by:
I am a relatively new user on Oracle 9.2.0.1 and I am having trouble performance tuning this production database. I am running a large query that joins two tables, document(3 mil) and entity(9...
2
by: Dan | last post by:
I am a relatively new user on Oracle 9.2.0.1 and I am having trouble performance tuning this production database. I am running a large query that joins two tables, document(3 mil) and entity(9...
5
by: Pedro Alves | last post by:
Hi. I'm having some trouble on the use of indexes. The querys below are exactly the same but refer to different months. One case uses indexes, the other doesn't. Is there anything I can do?...
0
by: Rolan | last post by:
I know what I want to do regarding the average cost for inventory, but need some assistance to sort out some of the details to finalize an inventory table and query. Essentially, the information is...
0
by: stig erikson | last post by:
Hello. For a project we are planning cost management. Each "user" should pay for the cost he/she generates on the postgresql server. The idea is that a query should be charged by the ammount of...
0
by: negmat | last post by:
Does anyone know how exactly the sub-tree cost is calculated and whether it should be used as an indication of query/stored procedure performance? I used to think (although I could never find a...
2
by: raisq1 | last post by:
I have two tables: Expense Table: ( Contains miscellaneous expenses incurred while the goods are transported ) Expense_Type ContainerID Expense_Dollar Labour 20301 5000.00 ...
7
by: skaushik | last post by:
Hi all, I was working on a SQL query where a history table is joined with a small table to get some information. There is an index on the history table column but the explain plan tells that there...
12
code green
by: code green | last post by:
I need to monitor the change in the cost price of products. The historic cost of every product is stored in a table 'trade' So by comparing the latest two entries per product based on the field...
2
by: cday119 | last post by:
So I am having a difficult time with some clients. The database is set up like this tblOrder tblOrder_Item_Bridge tblItem internal_id item_id ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.