Link to home
Start Free TrialLog in
Avatar of joe_echavarria
joe_echavarriaFlag for Dominican Republic

asked on

How much time the index creation takes.

Hi,

  I am creating an index , and i want to know how much time it will take to finish.  Is been running for like 20 hours, and i will like to know the % it has complete so far.

  Below is the sql .

  CREATE INDEX "xxxxx"."CTXT_IDX_DVC_1" ON "xxxxxx"."DVC_DOCUMENT_
VAULT" ("DVC_CONTENT")      INDEXTYPE IS "CTXSYS"."CONTEXT" ;


  Thank you.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

It takes as long as it takes... Sorry, too much depends on your specific system.

you can see how many rows have been indexed with:
select idx_docid_count from ctx_user_indexes where idx_name='CTXT_IDX_DVC_1';

On slower hardware, I once had a Text index that would take 7 days to rebuild.
Avatar of joe_echavarria

ASKER

How can we know how many rows it still needs to rebuild ?
Take the number of rows in the table, subtract it from how many have been indexed?
Yes, but the query

 select idx_docid_count from ctx_user_indexes where idx_name='CTXT_IDX_DVC_1';

  does not return any value.


something might be wrong ?
I suppose I should make one additional comment on my last post:
It may not be exact if new rows are being inserted into the table while the index is being created.  There is a ctx_user_pending view that will show the 'new' rows awaiting indexing.


I should also ask if you know that by default, a Text Context index needs to be manually synced when new rows are added to the table?

Text indexes are not like your normal BTree indexes.  They require special handling.
>>  does not return any value.

Are you logged in to the database as the user that owns the index?

In your example above this would be: xxxxx.

You specific that as the owning schema.

You could try:
select idx_docid_count from ctxsys.ctx_indexes where idx_owner='XXXXX' and idx_name='CTXT_IDX_DVC_1';

Where XXXXX is the correct index owner.
Currently the database is not being used now.  No users are connected.

select * from ctx_user_indexes  -- returns no rows.


select idx_docid_count from ctxsys.ctx_indexes where idx_owner='XXXXX' and idx_name='CTXT_IDX_DVC_1';  --- returns 58627.   This value does not increment.


select count(*) from smartsolve.DVC_DOCUMENT_VAULT; --- returns 253573
>>select * from ctx_user_indexes  -- returns no rows.

This needs to be executed while logged in to the database as the OWNER of the index.

>>--- returns 58627.   This value does not increment.

It can take time to index each individual row.  Again, Text indexes are NOT your normal index.  There is a lot happening behind the scenes for each and every row being indexed.

>>--- returns 253573

If you have 253,573 rows and you have only indexed, 58,627 of them, you'll be waiting for quite a while...

You'll need to estimate the time:  How long has it taken to index the 58,000?  If all the data in that column is about average, you should be able to estimate the time remaining.

Remember my post above:  I had a Text index that would take 7 days to build.
VERY rough math:  If the 58,627 has been running for an hour, you should have a little over three hours to go.
no, 58,627.00 in a day.

So, we have 3 days to go at least.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeah, thanks you.

Let us wait on monday.