473,383 Members | 1,748 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,383 software developers and data experts.

Index

Am having a primary key on a column called "x" and not null column on "Y" which will have repeating values .

select * from table_name where y='...' ;

it will take full table scan.But i need to reduce the cost and time to retrieve the row values.whatz the solution?
Mar 20 '07 #1
5 1422
Dave44
153 100+
Am having a primary key on a column called "x" and not null column on "Y" which will have repeating values .

select * from table_name where y='...' ;

it will take full table scan.But i need to reduce the cost and time to retrieve the row values.whatz the solution?
what kind of values will Y have? strings or numbers?

are there any other fields in the table that can be used to restrict the data?
Mar 20 '07 #2
vijaydiwakar
579 512MB
Am having a primary key on a column called "x" and not null column on "Y" which will have repeating values .

select * from table_name where y='...' ;

it will take full table scan.But i need to reduce the cost and time to retrieve the row values.whatz the solution?
pls explain with some data and tbl desc
Mar 21 '07 #3
pls explain with some data and tbl desc

x and y are numbers and x is the primary key and we can allow repeating values for y and search criteria is on y .
Mar 21 '07 #4
vijaydiwakar
579 512MB
x and y are numbers and x is the primary key and we can allow repeating values for y and search criteria is on y .
See the basic aim to have PK is to reduce the time and redudant calls as ur search is on Y which is not PK then Ora will cunsume resources and hence increses the time of execution
though u can use Index on column Y
try it
Good Luck
Mar 21 '07 #5
Dave44
153 100+
x and y are numbers and x is the primary key and we can allow repeating values for y and search criteria is on y .
If there is no index (thus logical way for oracle) to reduce the rows it needs to look at then a full table scan will have to be done so oracle can be sure it doesnt miss any.

Also even with an index on the field, if oracle determines that more than 20% of the rows need to read it becomes faster for oracle to perform a full scan anyway.

How large would this table be (or get to be)?
Mar 22 '07 #6

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

Similar topics

3
by: Jofio | last post by:
Hello, I am a newbie in PHP and I am enthusiastically trying out things. I've just replaced my index.html ( file with index.php
9
by: kosh | last post by:
I was wondering if there is or there could be some way to pass a generator an optional starting index so that if it supported that slicing could be made more efficient. Right now if you do use a...
2
by: skura | last post by:
I am trying to understand how the data in sql server is stored and also regarding fill factor and page splitting. 1) My first question what is the difference between Index pages and Data pages....
6
by: Anita | last post by:
I have just tested 3 queries using QA. The complete test information : ------ CREATE TABLE agls1 ( fyear char(4) NULL , fprefix char(3) NULL , fvcno char(20) NULL , fdate datetime NULL ,...
8
by: Andr? Queiroz | last post by:
Hi, I have a table with 10M records and col A has a index created on it. The data on that table has the same value for col A on all 10M records. After that I insert diferent values for that column...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
4
by: Steph. | last post by:
I have a List view displaying data in Detail mode with several columns. How I can get the column index the user clicked on ? (when user click on an item inside the ListView, not on a column...
2
by: bobby_b_ | last post by:
I have a table where fields 1 and 2 make up the primary key. Because of this, I have a unique composite index on fields 1 and 2 (as required by DB2). Now my question is: Fields 1 and 2 are also...
85
by: Russ | last post by:
Every Python programmer gets this message occasionally: IndexError: list index out of range The message tells you where the error occurred, but it doesn't tell you what the range and the...
8
by: shira | last post by:
I have done a fair bit of searching, but haven't yet been able to find an explanation as to why one would set "ignore nulls" to "yes" when creating an index. I understand what it does (I think),...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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...
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.