One bitmap index works, one has no effect
Poor performance with following:
select a, b
from tablea
where c = 'Y'
and d = 'Y'
c and d are char(1) with NULLS or 'Y'. Bitmap index created for each (separately). Query takes 4.5s. If the restriction on d is removed - 4.3s. If the restriction on c is removed, and d left in - 0.2s. Why the disparity for seemingly identical attributes?
How many records are in the table?
How many records have C = 'Y'?
How many records have D = 'Y'?
If there are 8 million records, 7 million have C = 'Y' and only 1 have D = 'Y' the C part of the query will skew the numbers the way you described.
null
Similar Messages
-
Unable to create a bitmap index
Hi,
I want to create a bitmap index on one of the colums on a table. I fired following query and it failed.
SQL> CREATE BITMAP INDEX TRANS_N_BITMAPIDX_VEH_PLATFORM ON TRANSACTION_NEW(VEH_PLATFORM) LOCAL;
Error starting at line 2 in command:
CREATE BITMAP INDEX TRANS_N_BITMAPIDX_VEH_PLATFORM ON TRANSACTION_NEW(VEH_PLATFORM) LOCAL
Error at Command Line:2 Column:70
Error report:
SQL Error: ORA-01408: such column list already indexed
01408. 00000 - "such column list already indexed"
*Cause:
*Action:I found there is a combined NORMAL index with VEH_PLATFORM column called ‘IDX$$_30AA00021’. It has following columns
• VEH_PLATFORM
• VEH_MODEL
• MODL_YR_NBR
• VEH_MAKE
• TXN_PROCS_DT
But I was able to create bitmap index on VEH_MODEL,MODL_YR_NBR and VEH_MAKE columns without any error.
Why does it error out for VEH_PLATFORM column?
Regards,
SamHi,
I am sure that BITMAP index is only created for
VEH_MAKE
VEH_MODEL
MODL_YR_NBR
BUILD_REGION
VEH_LINE_SERIES
TRANS_CTG_ID
and not for VEH_PLATFORM.
SQL> SELECT * FROM USER_INDEXES WHERE INDEX_TYPE='BITMAP' AND TABLE_NAME='TRANSACTION_NEW';
INDEX_NAME INDEX_TYPE TABLE_OWNER TABLE_NAME TABLE_TYPE UNIQUENESS COMPRESSION PREFIX_LENGTH TABLESPACE_NAME INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE PCT_THRESHOLD INCLUDE_COLUMN FREELISTS FREELIST_GROUPS PCT_FREE LOGGING BLEVEL LEAF_BLOCKS DISTINCT_KEYS AVG_LEAF_BLOCKS_PER_KEY AVG_DATA_BLOCKS_PER_KEY CLUSTERING_FACTOR STATUS NUM_ROWS SAMPLE_SIZE LAST_ANALYZED DEGREE INSTANCES PARTITIONED TEMPORARY GENERATED SECONDARY BUFFER_POOL FLASH_CACHE CELL_FLASH_CACHE USER_STATS DURATION PCT_DIRECT_ACCESS ITYP_OWNER ITYP_NAME PARAMETERS GLOBAL_STATS DOMIDX_STATUS DOMIDX_OPSTATUS FUNCIDX_STATUS JOIN_INDEX IOT_REDUNDANT_PKEY_ELIM DROPPED VISIBILITY DOMIDX_MANAGEMENT SEGMENT_CREATED
TRANS_N_BITMAPIDX_MAKE BITMAP VISUAL TRANSACTION_NEW TABLE NONUNIQUE DISABLED 2 6102 20 305 611 12226 N/A 12226 2208 11-MAY-11 1 1 YES N N N DEFAULT DEFAULT DEFAULT NO YES NO NO NO VISIBLE N/A
TRANS_N_BITMAPIDX_MODEL BITMAP VISUAL TRANSACTION_NEW TABLE NONUNIQUE DISABLED 2 11284 158 71 144 22813 N/A 22813 2321 11-MAY-11 1 1 YES N N N DEFAULT DEFAULT DEFAULT NO YES NO NO NO VISIBLE N/A
TRANS_N_BITMAPIDX_BUILD_REGION BITMAP VISUAL TRANSACTION_NEW TABLE NONUNIQUE DISABLED 2 2911 5 582 1161 5808 N/A 5808 5808 11-MAY-11 1 1 YES N N N DEFAULT DEFAULT DEFAULT NO YES NO NO NO VISIBLE N/A
TRANS_N_BITMAPIDX_MODL_YR_NBR BITMAP VISUAL TRANSACTION_NEW TABLE NONUNIQUE DISABLED 2 2911 5 582 1161 5808 N/A 5808 5808 11-MAY-11 1 1 YES N N N DEFAULT DEFAULT DEFAULT NO YES NO NO NO VISIBLE N/A
TRANS_N_BITMAPIDX_TRANS_CTG_ID BITMAP VISUAL TRANSACTION_NEW TABLE NONUNIQUE DISABLED 2 7547 43 175 359 15457 N/A 15457 2345 11-MAY-11 1 1 YES N N N DEFAULT DEFAULT DEFAULT NO YES NO NO NO VISIBLE N/A
TRANS_N_BITMAPIDX_VEH_LINE_S BITMAP VISUAL TRANSACTION_NEW TABLE NONUNIQUE DISABLED 2 10581 253 41 84 21477 N/A 21477 2247 11-MAY-11 1 1 YES N N N DEFAULT DEFAULT DEFAULT NO YES NO NO NO VISIBLE N/A
6 rows selectedRegards,
Sam -
Hi All,
We have one BITMAP index on a flag column (Y/N).Table is non partitioned with 3.4 million records.
Following are index stats.
select INDEX_NAME,INDEX_TYPE,BLEVEL,LEAF_BLOCKS,DISTINCT_KEYS,CLUSTERING_FACTOR,NUM_ROWS,SAMPLE_SIZE,DEGREE FROM DBA_INDEXES WHERE
INDEX_NAME='LATE_VER_FLG_CAX_IDX' AND OWNER='EQHUB'
INDEX_NAME INDEX_TYPE BLEVEL LEAF_BLOCKS DISTINCT_KEYS CLUSTERING_FACTOR NUM_ROWS SAMPLE_SIZE DEGREE
LATE_VER_FLG_CAX_IDX BITMAP 11 716 2 72783 72783 72783 1
select last_analyzed,sample_size,num_rows from dba_indexes where index_name='LATE_VER_FLG_CAX_IDX';
LAST_ANALYZED SAMPLE_SIZE NUM_ROWS
31.Jan.09/00:29:41 72783 72783
NAME HEIGHT BLOCKS LF_ROWS LF_BLKS LF_ROWS_LEN BR_ROWS BR_BLKS DEL_LF_ROWS DISTINCT_KEYS BTREE_SPACE USED_SPACE PCT_USED
LATE_VER_FLG_CAX_IDX 12 4352 0 0 1 1 0 0 8028
CREATE BITMAP INDEX "EQHUB"."LATE_VER_FLG_CAX_IDX" ON "EQHUB"."BBO_CORPORATE_ACTIONS" ("LATEST_VERSION_FLAG")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 2097152 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "ETDHUB_EQHUB_INDEX"
SQL> select LATEST_VERSION_FLAG,count(*) from BBO_CORPORATE_ACTIONS group by LATEST_VERSION_FLAG;
L COUNT(*)
N 2265303
Y 1189116I am wondering
1.What can be done to reduce index BLEVEL/HEIGHT? (i assume COALESCE will not help)..Should i rebuild the index?
2.Why BTREE_SPACE is only showing 8028 where dba_segments is showing index size =34 MB?
3.Why PCT_USED is NULL?
Is that so BLEVEL/PCT_USED not relative for BITMAP Indexes?
I found that no query is using this index for last 60 days and performance is getting degraded due to FTS.
Should i REBUILD the index so that i can reduce BLEVEL/HEIGHT/INDEX_SIZE and improve query performance with INDEX ACCESS.
Regards,
Bhavik DesaiBhavik Desai wrote:
You perfectely caught the DML pattern.There are 4 daily ELT jobs which INSERT 300 and UPDATE 250 records/execution.
May i ask you,upon which observation,you point this?Also it would be greate if you tell me how did you calculate 67% PCT_FREE.
This was based on the fact that an update to a single row in a table could result in a copy of an entire bitmap index chunk being made; so you need to leave a lot of space free in the leaf blocks to allow for these copies because you really don't want to cause an index leaf block split to occur - especially since that would tend to cascade up the index and cause a branch block split as well. On this basis, pctfree 51 should be adequate for most cases, but setting it to 67 (a) allows you to do a couple of updates/clones to the same chunk before you hit a problem, and (b) helps to keep the chunks smaller which helps to reduce the undo and redo a bit.
This has just reminded me of a little detail - I am a little surprised by the fact that you got an index into this state in 10.2, because that release of Oracle seems to avoid creating a long chain of clones of the same index chunk when you do a series of small updates, and it is the chain of clones that results in branch blocks split running up the index and exploding it to an enormous height. Has this database been upgraded from 9i (or even 10.1) some time in the fairly recent past ?
>
I still dont understand,
1.Why there is no difference in BTREE_SPACE?
2.Why PCT_USED is NULL?
I've just run a quick test on 10.2.0.1 and 10.2.0.3 creating a table with a y/n/null column and creating a bitmap index on it. The results from index_stats didn't match across versions, and the 10.2.0.3 stats were clearly garbage - very similar to yours. For the moment I would assume that something has been broken in 10.2.0.3 with this use of the validate command.
>
If we consider Franck Pachot's observation,then it would be better to convert the BITMAP to BTREE.Is this a normal bitmap behavior?Randolf's observation about the numbers of rows involved is most relevant: it doesn't look like an index that the optimizer should consider using for anything other than select flag, count(*), and changing from a bitmap to a btree won't make any difference. In other words, unless you can point to an important piece of code and say "it makes tis bit run much better" maybe the index shouldn't exist at all.
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
"The temptation to form premature theories upon insufficient data is the bane of our profession."
Sherlock Holmes (Sir Arthur Conan Doyle) in "The Valley of Fear". -
Multi-column BITMAP index vs. multiple BITMAP indices?
Given the table (simple, made-up example):
CREATE TABLE applicant_diversity_info (
applicant_diversity_id NUMBER(12), PRIMARY KEY(applicant_diversity_id),
apply_date DATE,
ssn_salted_md5 RAW(16),
gender CHAR(1), CHECK ( (gender IS NULL OR gender IN ('M','F')) ),
racial_continent VARCHAR2(30), CHECK ( (racial_continent IS NULL
OR racial_continent IN ('Europe','Africa','America','Asia_Pacific')) ),
ethnic_supergroup VARCHAR2(30), CHECK ( (ethnic_supergroup IS NULL OR ethnic_supergroup IN ('Latin American','Other')) ),
hire_salary NUMBER(11,2),
hire_month DATE,
termination_salary NUMBER(11,2),
termination_month DATE,
termination_cause VARCHAR2(30), CHECK ( (termination_cause IS NULL
OR termination_cause IN ('Resigned','Leave of Absence','Laid Off','Performance','Cause')) )
Oracle (syntactically) allows me to create either one BITMAP index over all four small-cardinality columns
CREATE BITMAP INDEX applicant_diversity_diversity_idx ON applicant_diversity_info (
gender, racial_continent, ethnic_supergroup, termination_reason );
or four independent indexes
CREATE BITMAP INDEX applicant_diversity_gender_idx ON applicant_diversity_info ( gender );
CREATE BITMAP INDEX applicant_diversity_race_idx ON applicant_diversity_info ( raceial_continent );
etc.
What is the difference between the two approaches; is there any meaningful difference in disk-space between the one multi-colum index and the four single-column indexes? Does it make a difference in what the query-planner will consider?
And, if I define one multi-column BITMAP index, does the order of columns matter?>
What is the difference between the two approaches; is there any meaningful difference in disk-space between the one multi-colum index and the four single-column indexes? Does it make a difference in what the query-planner will consider?
And, if I define one multi-column BITMAP index, does the order of columns matter?
>
You may want to read this two-part blog, that answers that exact question, by recognized expert Richard Foote
http://richardfoote.wordpress.com/2010/05/06/concatenated-bitmap-indexes-part-i-two-of-us/
http://richardfoote.wordpress.com/2010/05/12/concatenated-bitmap-indexes-part-ii-everybodys-got-to-learn-sometime/
As with many things Oracle the answer is 'it depends'.
In short the same considerations apply for a concatenated index whether it is bitmap or b-tree: 1) will the leading column usually be in the predicate and 2) will most or all of the index columns be specified in the queries.
Here are some quotes from part 1
>
Many of the same issues and factors in deciding to create a single, multi-column index vs. several, single column indexes apply to Bitmap indexes as they do with B-Tree indexes, although there are a number of key differences to consider as well.
Another thing to note regarding a concatenated Bitmap index is that the potential number of index entries is a product of distinct combinations of data of the indexed columns.
A concatenated Bitmap index can potentially use less or more space than corresponding single column indexes, it depends on the number of index entries that are derived and the distribution of the data with the table.
>
Here is the lead quote from part 2
>
The issues regarding whether to go for single column indexes vs. concatenated indexes are similar for Bitmap indexes as they are for B-Tree indexes.
It’s generally more efficient to access a concatenated index as it’s only the one index with less processing and less throwaway rowids/rows to contend with. However it’s more flexible to have single column indexes, especially for Bitmap indexes that are kinda designed to be used concurrently, as concatenated indexes are heavily dependant on the leading column being known in queries. -
How bit map index works?
I am not getting an example for bitmap index mechanism.
Supposing their is a table T1 with column c1 having records
Y
N
N
Y
Y
N
and i query the table like
select * from t1 where c1 = 'Y'
How bit map index functions?
thanks,
VinodhI think you should check the google's new feature to explore -> [How bitmap Index Works|http://www.google.co.in/search?hl=en&rlz=1G1GGLQ_ENIN333&q=how+bitmap+index+works&meta=&aq=0&oq=how+bitma]
Regards.
Satyaki De. -
If I have two email accounts, one personal hotmail account and one MS Exchange work account on my iPhone 4s, How can I setup individual notifications for each account? Fore example, if I get a work email, I want to hear a DING, DING....If I get a personal email, I want to hear a BEEP, BEEP. Right now, any email from any account has the same notification. I want work incoming email notification to be different than personal incoming notification. The only semi-workaround I've seen is just disable any notification for the Hotmail account, so only work emails would notify. But then I don't know when I get a personal email. Even the lowely Blackberry Torch 9800 has this feature..not iPhone 4s??
ThanksSorry you get only one notification sound for all email accounts. you can send a suggestion to apple here http://www.apple.com/feedback/
-
After upgrade to FCPX 10.1, paste attributes no longer works. Has anyone had this issue or have an answer to it?
Are you sure it does not work at all? Could be a problem with a particular project, or clip.
Create a completely new project, add some clips to it, Cmd-C in one clip, and try Paste Atributes into another. Does it not work?
Also, by "does not work" do you mean it is greyed out, or the window appears but nothing happens when you click "Paste"? -
My Mac Mini doesn't recognize my Avengers DVD--it keeps saying "Supported disc not available." I've tried other DVD's which work, but not this one. itunes and everything else has been updated to the newest versions. Help? Also...It doesn't recognize the digital copy DVD.
I have ALL the exact same symptoms as on my home computer.
It sure sounds to me like something on the iPod is broken. If it's under warranty then I would send it back for repair. If not, check out some of the web repair services, such as iPodResQ etc. -
I only have one apple ID and facetime has worked with it before, but now I get the message "Unable to verify email because it is already in use". I have looked ofr a solution but can't find one. can anyone help please?
I spoke with Apple Support this morning and they believe anything MobileMe related is due to the conversion over to iCloud that's taking place.
As for other email clients, check with your host to see if settings have changed on their end. I use inmotionhosting.com and over the weekend the updated their outgoing requirements so that a password authentication is now needed.
Hope that helps get some on the right path to resolving their issues! -
My one day old nano 6 has stopped working and will not restart can you help?
my one day old nano 6 has stopped working and will not restart can you help?
try this........ http://www.apple.com/support/ipodnano/assistant/itunes/
-
I'm using Firefox 3.6.17, and have installed Rikaichan 2.02. Once I've installed the Japanese-English dictionary, I then click on Rikaichan to get it started, and it always gives a "Javascript Application" error:
'''"The index for one or more dictionaries needs to be created. This may take a while on slower computers"'''
Rikaichan always works fine on my laptop, but I just can't seem to install it properly at work. Is there some sort of office security screwing it up?venicespent,
Boot into your Mavericks Recovery partition by hold down the command and R keys whilst booting. You'll see a screen that looks like this:
Click on the Disk Utility item to open Disk Utility. You should see your boot drive (usually named "Macintosh HD" unless you've changed it) in the column on the left of the screen. Select your boot partition and click on the "Verify" button. Let your Mac do it's thing - if you get green text telling you that everything seems to be OK, then your disk should not be damaged. If, however, you get red text telling you that the disk needs to be repaired, click on the "Repair" button. If the disk can be repaired, you should be good to go. If the disk cannot be repaired then the drive is damaged.
But before you do anything, make certain that you have backups!!!
Clinton
MacBook Pro (15-inch Late 2011), OS Mavericks 10.9.4, 16GB RAM, 960GB SSD, 27” Apple Thunderbolt Display -
iTunes has stopped allowing me to import CDs. if I reboot it will import one, and only one. all was working fine before. the itunes diagnostics have all green lights
For general advice see Troubleshooting issues with iTunes for Windows updates.
The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
If you've already tried a complete uninstall and reinstall try opening iTunes in safe mode (hold down CTRL+SHIFT as you start iTunes) then going to Edit > Preferences > Store and turning off Show iTunes in the Cloud purchases. You may find iTunes will now start normally.
You could also try working through
TS1717: iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
tt2 -
one of my ipod apps has frozen on waiting, I've tried everything. (Restarting it, plugging it into the computer, in setting etc...) and also I tried deleting it, but no "X" comes up. but nothing is working. Really annoyed. :( please help. ,
See:
Downloading apps stuck on waiting...: Apple Support Communities
\Waiting applications: Apple Support Communities -
The ipad screen has went white and has a gray line running through the middle of it. It worked one minute and not the next. It has not been jail broken.
Have you tried restarting or resetting your iPad?
Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after It shuts down, press the On/Off button until the Apple logo appears.
Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10-15 seconds). No data will be lost. -
I use an iPad 2 at work that has a different apple id for iCloud than my own personal new iPad. How can I change the company's id for iCloud to synchronize with my own personal iPad?
Go to Settings>iTunes and App Stores and tap the Apple ID listed and sign out and sign in with other ID
You also may want to go to other places like:
- Settings>iCloud
- Settinge>FaceTime
- Settings>Messages>Send and Receive and change the ID
It may be best to go to Settings>General>Reset>Erase all Content and Settings and start over again and set up the iPod again with his account/ID
Maybe you are looking for
-
"Show in Finder" is never enabled in File Menu
For some reason I can never get the "Show in Finder" selection in the File menu to become enabled. It is always "grayed out". I have a photo selected, and then choose the File menu and go to "Show in Finder" but the option is grayed out. Am I doing s
-
Screen is no longer in widescreen mode. how do i get it back?!
screen is no longer in widescreen mode. how do I get it back?
-
Restoring Windows XP on Qosmio G20
Hi all, I have problems with my Qosmio running slow and I suspect some virus or Trojan. So I have decided to restore my system but my surprise is that I cannot find a cd of windows restoration. Is that possible? I only have a CD that says QosmioPlaye
-
Mapping usb drive with rdesktop to windows server/XP
I have read that the -r option with rdesktop allows you to map a local usb drive on a linux pc to a windows server or XP as follows: rdesktop -r disk:usb=<path> <ipaddress> I have arch installed with a base gnome so that usb drives are automatically
-
How do you set lens adjustment universally
I just downloaded LR 3.2 I am going through my photos. do I need to take each photo and go to development and then select the lens used or is there a way to change the preferences so this will just happen. also, does the program automatically somewh