{"record":{"id":"b3c435f48a173128","repo":"prestodb/presto","slug":"index-loader-timeout","errorCode":"INDEX_LOADER_TIMEOUT","errorMessage":"Exceeded the time limit of %s loading indexes for index join","messagePattern":"Exceeded the time limit of (.+?) loading indexes for index join","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/index/IndexLoader.java","lineNumber":355,"sourceCode":"        }\n\n        public boolean load(List<UpdateRequest> requests)\n        {\n            // Generate a RecordSet that only presents index keys that have not been cached and are deduped based on lookupSourceInputChannels\n            UnloadedIndexKeyRecordSet recordSetForLookupSource = new UnloadedIndexKeyRecordSet(pipelineContext.getSession(), indexSnapshotReference.get(), lookupSourceInputChannels, indexTypes, requests, joinCompiler);\n\n            // Drive index lookup to produce the output (landing in indexSnapshotBuilder)\n            try (Driver driver = driverFactory.createDriver(pipelineContext.addDriverContext())) {\n                PlanNodeId sourcePlanNodeId = driverFactory.getSourceId().get();\n                ScheduledSplit split = new ScheduledSplit(0, sourcePlanNodeId, new Split(INDEX_CONNECTOR_ID, new ConnectorTransactionHandle() {}, new IndexSplit(recordSetForLookupSource)));\n                driver.updateSource(new TaskSource(sourcePlanNodeId, ImmutableSet.of(split), true));\n                while (!driver.isFinished()) {\n                    ListenableFuture<?> process = driver.process();\n                    try {\n                        process.get(timeout.toMillis(), MILLISECONDS);\n                    }\n                    catch (TimeoutException e) {\n                        throw new PrestoException(INDEX_LOADER_TIMEOUT, format(\"Exceeded the time limit of %s loading indexes for index join\", timeout));\n                    }\n                    catch (ExecutionException e) {\n                        throw new PrestoException(GENERIC_INTERNAL_ERROR, \"Error loading index for join\", e);\n                    }\n                    catch (InterruptedException e) {\n                        Thread.currentThread().interrupt();\n                        throw new PrestoException(GENERIC_INTERNAL_ERROR, \"Error loading index for join\", e);\n                    }\n                }\n            }\n\n            if (indexSnapshotBuilder.isMemoryExceeded()) {\n                clearCachedData();\n                return false;\n            }\n\n            // Generate a RecordSet that presents unique index keys that have not been cached\n            UnloadedIndexKeyRecordSet indexKeysRecordSet = (lookupSourceInputChannels.equals(allInputChannels))","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/index/IndexLoader.java#L337-L373","documentation":"IndexLoader.load builds the index snapshot for an index join by driving a Driver and awaiting each process() future with a timeout. If the index build does not finish within the configured limit, the library throws INDEX_LOADER_TIMEOUT so the query fails fast instead of hanging.","triggerScenarios":"Index join where building/loading the lookup index from the probe-side source takes longer than the index-loader timeout (process.get(timeout) raises TimeoutException).","commonSituations":"Very large build side for the index join; slow underlying connector for index lookups; too-low 'index-loader-timeout' config for the workload.","solutions":["Increase the index-loader timeout in the coordinator config (index-loader-timeout)","Rewrite the join as a regular hash join (disable index join) so a full build is used","Reduce the amount of data going through the index join with better filtering","Increase worker resources / parallelism to speed index building"],"exampleFix":"// before\nquery-properties: index-loader-timeout=30s\n// after\nquery-properties: index-loader-timeout=5m (or disable index join for this query)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { runIndexJoinQuery(sql); } catch (PrestoException e) { if (e.getErrorCode().getName().equals(\"INDEX_LOADER_TIMEOUT\")) { // increase timeout or fall back to hash join\n  retryWithHashJoin(sql); } else throw e; }","preventionTips":["Size the index-loader timeout to your largest index joins","Filter build-side data so index builds stay small","Monitor index build durations and alert on timeouts","Consider join_distribution_type=PARTITIONED to avoid index joins when not needed"],"tags":["presto","index-join","timeout","performance"],"backgroundTag":"index-build-timeout","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}