cancel
Showing results for 
Search instead for 
Did you mean: 

How do i find remaining time for a long running query?

Highlighted
Level 3 Adventurer

How do i find remaining time for a long running query?

Hi All,

 

Is there any way by which i can find, how much time a query will take to complete it's execution. 

 

Like In Oracle, we have v$session_longops. Is there any catalogue view in EDB Postgres?

 

This is in regards to a create index statement that is running for five hours on a table of size 300GB  and i want to know how much more time it will take?

 

Thank you!

2 REPLIES 2
Level 3 Adventurer

Re: How do i find remaining time for a long running query?

You can check any query expected runtime through explain command. However create index will take considerable time based on its datatype, and it has to insert the entire column data in that index. I hope you have used concurrent option to create the index, to avoid explicit locking.

Level 3 Adventurer

Re: How do i find remaining time for a long running query?

Hi @ameenabbas,

 

Thank you for the update.

We are doing a backup and restore using pg_dump and psql.Create index is taking time during restoration.

Here, the table size on which the create index is running is around 300GB and so i need to find how much time more it will take to complete(i.e the remaining time)

 

Thanks!