Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-3-5-sonnet-20241022· AnthropicHugging Face LMArena Human Preference 140K

how to see progress of concurrent index creation in postgres?

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514’s answer.
  1. User

    how to see progress of concurrent index creation in postgres?

  2. Claude Assistant

    Here's how you can monitor concurrent index creation progress in PostgreSQL:

    1. Using pg_stat_progress_create_index view (PostgreSQL 12+):
    SELECT 
        pid,
        phase,
        blocks_total,
        blocks_done,
        tuples_total,
        tuples_done,
        round((blocks_done::float / blocks_total) * 100, 2) as progress_percentage
    FROM pg_stat_progress_create_index;
    
    1. You can also check the process using pg_stat_activity:
    SELECT pid, state, query 
    FROM pg_stat_activity 
    WHERE query LIKE 'CREATE INDEX%';
    
    1. For system-level monitoring, you can use the process ID (pid) to check I/O activity:
    iostat -x 1
    # or
    iotop -p <pid>
    

    The pg_stat_progress_create_index view is the most informative as it shows:

    • Current phase of index creation
    • Number of blocks processed vs total blocks
    • Number of tuples processed vs total tuples
    • Calculated percentage of completion

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.

how to see progress of concurrent index creation in… · The Chat Archive