Skip to main content

Convex Index Audit

Static read-only audit of convex/. Generated by scripts/audit-convex-indexes.ts. No runtime code or schema was modified. This report is a snapshot — re-run the script to refresh it.
  • Generated: 2026-06-06T00:46:52.298Z
  • Schema source: convex/schema.ts
  • Convex files scanned: 235
  • Tables declared: 109 (with 342 total indexes)
  • Tables with zero indexes: 1
  • Queries: 1022 total — 944 use .withIndex(...), 78 look like table scans
  • Missing index references: 0
  • .collect() calls: 74 total — 74 bounded (scoped by .withIndex(...) or capped by .take(N)), 0 unbounded

A. Tables & indexes

TableIndexFields
ghlInstallationsby_companycompanyId
ghlInstallationsby_locationlocationId
ghlInstallationsby_createdAtcreatedAt
ghlInstallationsby_expiresAtexpiresAt
roundRobinStateby_locationIdlocationId
leadReassignmentAuditsby_locationId_and_createdAtlocationId, createdAt
usersby_user_iduserId
organizationsby_locationlocationId
organizationMembershipsby_orgorgId
organizationMembershipsby_user_orguserId, orgId
creditReportRequestsby_requestrequestId
creditReportRequestsby_requestId_locationIdrequestId, locationId
creditReportRequestsby_contactcontactId
creditReportRequestsby_contact_location_createdAtcontactId, locationId, createdAt
creditReportRequestsby_companycompanyId
creditReportRequestsby_locationlocationId
creditReportRequestsby_createdAtcreatedAt
creditReportRequestsby_location_createdAtlocationId, createdAt
creditReportRequestBlobsby_requestrequestId
creditReportRequestBlobsby_creditReportcreditReportId
stitchCreditTokens(no indexes)
underwritingResultsby_reportreportId
underwritingResultsby_report_createdAtreportId, createdAt
underwritingResultsby_contactcontactId
underwritingResultsby_contact_location_createdAtcontactId, locationId, createdAt
underwritingResultsby_locationlocationId
underwritingResultsby_createdAtcreatedAt
underwritingResultsby_location_createdAtlocationId, createdAt
cardsby_recordIdrecordId
cardsby_cardTypecardType
fundingPlansby_contactcontactId
fundingPlansby_locationlocationId
fundingPlansby_contact_locationcontactId, locationId
fundingPlansby_contact_location_createdAtcontactId, locationId, createdAt
fundingPlansby_createdAtcreatedAt
fundingPlansby_location_createdAtlocationId, createdAt
adminMetricsDailyby_metricType_dayBucketmetricType, dayBucket
columnConfigsby_location_tablelocationId, tableType
savedFiltersby_location_pagelocationId, pageType
zohoVerticalAccountsby_orgzohoOrgId
zohoInstallationsby_locationlocationId
zohoInstallationsby_orgzohoOrgId
migrationJobsby_locationlocationId
migrationJobsby_statusstatus
migrationJobsby_location_statuslocationId, status
migrationLogsby_jobjobId
migrationLogsby_zoho_recordzohoRecordId
migrationLogsby_job_statusjobId, status
crmStageFixRunsby_createdAtcreatedAt
crmStageFixRunsby_statusstatus
crmStageFixRunsby_location_createdAtlocationId, createdAt
migratedContactsby_ghl_contactghlContactId
migratedContactsby_locationlocationId
migratedContactsby_zoho_recordzohoRecordId
migratedContactsby_location_sourcelocationId, dataSource
migratedContactsby_validation_statuslocationId, dateValidationStatus
dateAuditTrailby_ghl_contactghlContactId
dateAuditTrailby_locationlocationId
dateAuditTrailby_jobmigrationJobId
dateAuditTrailby_fieldghlContactId, fieldName
onboardingProgressby_locationlocationId
onboardingCallsby_locationlocationId
onboardingCallsby_location_typelocationId, callType
slackInvitesby_locationlocationId
communityAccessSettingsby_locationlocationId
locationSettingsby_locationlocationId
aiAgentRunsby_location_and_createdAtlocationId, createdAt
aiAgentRunsby_location_and_useCase_and_createdAtlocationId, useCase, createdAt
aiAgentRunsby_status_and_createdAtstatus, createdAt
aiAgentRunsby_approvalState_and_createdAtapprovalState, createdAt
contactInvoiceAgreementOverridesby_locationId_contactIdlocationId, contactId
locationGhlMappingsby_locationlocationId
customValuesby_locationlocationId
zohoLeadsby_orgzohoOrgId
zohoLeadsby_locationlocationId
zohoLeadsby_zoho_recordzohoRecordId
zohoLeadsby_org_recordzohoOrgId, zohoRecordId
zohoDealsby_orgzohoOrgId
zohoDealsby_locationlocationId
zohoDealsby_zoho_recordzohoRecordId
zohoDealsby_org_recordzohoOrgId, zohoRecordId
zohoCreditReportsby_orgzohoOrgId
zohoCreditReportsby_locationlocationId
zohoCreditReportsby_zoho_recordzohoRecordId
zohoCreditReportsby_syncedAtsyncedAt
zohoCreditReportsby_org_recordzohoOrgId, zohoRecordId
zohoCreditReportsby_leadzohoLeadId
zohoCreditReportsby_dealzohoDealId
setterCommissionSettingsby_locationlocationId
setterCommissionSettingsby_location_ghl_userlocationId, ghlUserId
locationCommissionDefaultsby_locationlocationId
closerCommissionSettingsby_locationlocationId
closerCommissionSettingsby_location_ghl_userlocationId, ghlUserId
fundingMachinesDealsby_zoho_recordzohoRecordId
fundingMachinesDealsby_orgzohoOrgId
fundingMachinesDealsby_org_recordzohoOrgId, zohoRecordId
fundingMachinesDealsby_closercloserId
fundingMachinesDealsby_appointment_eventappointmentEventId
fundingMachinesDealsby_lead_built_contactleadBuiltContactId
fundingMachinesDealsby_contact_phonecontactPhone
fundingMachinesDealsby_contact_emailcontactEmail
ghlSubscriptionsby_locationlocationId
ghlSubscriptionsby_syncedAtsyncedAt
ghlSubscriptionsby_location_syncedAtlocationId, syncedAt
ghlSubscriptionsby_location_status_syncedAtlocationId, status, syncedAt
ghlSubscriptionsby_location_subscriptionlocationId, ghlSubscriptionId
ghlSubscriptionsby_statusstatus
ghlSubscriptionsby_contactcontactId
ghlSubscriptionsby_contact_emailcontactEmail
salesCommissionsby_zoho_record_typezohoRecordId, eventType
salesCommissionsby_settersetterId
salesCommissionsby_setter_periodsetterId, payPeriodStart
salesCommissionsby_locationlocationId
salesCommissionsby_location_statusChangedAtlocationId, statusChangedAt
salesCommissionsby_location_periodlocationId, payPeriodStart
salesCommissionsby_pay_periodpayPeriodStart, isPaid
salesCommissionsby_orgzohoOrgId
closerCommissionsby_zoho_recordzohoRecordId
closerCommissionsby_closercloserId
closerCommissionsby_closer_periodcloserId, payPeriodStart
closerCommissionsby_locationlocationId
closerCommissionsby_location_periodlocationId, payPeriodStart
closerCommissionsby_pay_periodpayPeriodStart, isPaid
closerCommissionsby_orgzohoOrgId
processingSubmissionsby_contactcontactId
processingSubmissionsby_locationlocationId
processingSubmissionsby_contact_locationcontactId, locationId
processingSubmissionsby_statusstatus
processingSubmissionsby_location_statuslocationId, status
processingSubmissionsby_location_createdAtlocationId, createdAt
processingSubmissionCommentsby_submissionsubmissionId
processingSubmissionCommentsby_contact_locationcontactId, locationId
contactPipelineStatesby_locationlocationId
contactPipelineStatesby_location_pipelinelocationId, pipelineType
contactPipelineStatesby_contact_locationcontactId, locationId
contactPipelineStatesby_contact_location_pipelinecontactId, locationId, pipelineType
documentsby_contactcontactId
documentsby_contact_locationcontactId, locationId
documentsby_locationlocationId
documentsby_typefileType
documentsby_location_createdAtlocationId, createdAt
documentsby_ghlDocumentIdghlDocumentId
documentsby_ghlReferenceIdghlReferenceId
documentsby_externalUrlexternalUrl
documentUploadTokensby_tokentoken
documentUploadTokensby_contactcontactId
documentUploadTokensby_locationlocationId
termLoanSubmissionsby_contactcontactId
termLoanSubmissionsby_contact_locationcontactId, locationId
termLoanSubmissionsby_locationlocationId
termLoanSubmissionsby_location_submittedAtlocationId, submittedAt
termLoanSubmissionsby_statusstatus
termLoanSubmissionsby_location_createdAtlocationId, createdAt
termLoanSubmissionsby_leadUuidleadUuid
termLoanSubmissionsby_offersResultsUuidoffersResultsUuid
termLoanLeadEventsby_engineEventIdengineEventId
termLoanLeadEventsby_leadUuidleadUuid
termLoanLeadEventsby_submissionIdsubmissionId
termLoanLeadEventsby_leadUuid_eventCreatedAtleadUuid, eventCreatedAt
engineAnalyticsCursorsby_endpointendpoint
termLoanDraftsby_location_contactlocationId, contactId
processingFeesby_contactcontactId
processingFeesby_locationlocationId
processingFeesby_contact_locationcontactId, locationId
processingFeesby_statusstatus
processingFeesby_location_statuslocationId, status
processingFeesby_createdAtcreatedAt
processingFeesby_location_createdAtlocationId, createdAt
processingFeesby_location_status_createdAtlocationId, status, createdAt
contactInvoicesby_locationId_contactIdlocationId, contactId
contactInvoicesby_location_createdAtlocationId, createdAt
contactInvoicesby_invoiceIdinvoiceId
operatorInvoicesby_contact_location_createdAtcontactId, locationId, createdAt
operatorInvoicesby_statusstatus
operatorInvoicesby_dueDatedueDate
operatorInvoicesby_location_statuslocationId, status
operatorInvoicesby_location_createdAtlocationId, createdAt
operatorInvoicesby_sourceClientInvoiceIdsourceClientInvoiceId
operatorInvoicesby_mfmInvoiceIdmfmInvoiceId
billingChargesby_location_createdlocationId, createdAt
billingChargesby_requestrequestId
billingChargesby_eventeventId
locationBillingConfigby_locationlocationId
billingAlertsby_statusstatus
billingAlertsby_locationlocationId
billingAlertsby_location_statuslocationId, status
billingRetryQueueby_status_retrystatus, nextRetryAt
billingRetryQueueby_formSubmissionformSubmissionId
supportTicketsby_statusstatus
supportTicketsby_locationlocationId
supportTicketsby_location_statuslocationId, status
supportTicketsby_contactcontactId
supportSignalsby_source_and_sourceIdsource, sourceId
supportSignalsby_status_and_updatedAtstatus, updatedAt
supportSignalsby_classification_and_updatedAtclassification, updatedAt
supportSignalsby_linearIssueKeylinearIssueKey
supportVerificationsby_signalId_and_createdAtsignalId, createdAt
supportVerificationsby_classification_and_createdAtclassification, createdAt
supportClustersby_signaturesignature
supportClustersby_status_and_lastSeenstatus, lastSeen
supportClustersby_status_and_countstatus, count
supportDraftRepliesby_signalId_and_createdAtsignalId, createdAt
supportDraftRepliesby_status_and_updatedAtstatus, updatedAt
supportApprovalAuditby_signalId_and_approvedAtsignalId, approvedAt
supportApprovalAuditby_approvedAtapprovedAt
supportApprovalAuditby_approvedBy_and_approvedAtapprovedBy, approvedAt
supportMessageAcknowledgementsby_location_createdAtlocationId, createdAt
supportMessageAcknowledgementsby_location_contact_createdAtlocationId, contactId, createdAt
supportMessageAcknowledgementsby_inboundMessageIdinboundMessageId
clientHealthSnapshotsby_weekOfweekOf
clientHealthScoresby_contactcontactId
clientHealthScoresby_locationlocationId
clientHealthScoresby_location_categorylocationId, category
locationNotesby_location_createdAtlocationId, createdAt
onboardingSubmissionsby_submission_idsubmissionId
onboardingSubmissionsby_statusstatus
onboardingSubmissionsby_companycompanyName
onboardingSubmissionsby_createdAtcreatedAt
provisioningJobsby_submissionsubmissionId
provisioningJobsby_statusstatus
provisioningJobsby_createdAtcreatedAt
provisioningLogsby_jobjobId
provisioningLogsby_statusstatus
partnerReferralLinksby_clerk_orgclerkOrgId
partnerReferralLinksby_dub_linkdubLinkId
partnerOrganizationsby_clerk_orgclerkOrgId
partnerOrganizationsby_slugslug
partnerOrganizationsby_locationlocationId
applicantCreationLocksby_contact_pipelinelocationId, contactId, pipelineId
outreachCallLocksby_partnerpartnerId
leadEventsby_locationlocationId
leadEventsby_contact_locationcontactId, locationId
leadEventsby_contact_location_createdAtcontactId, locationId, createdAt
leadEventsby_status_createdAtstatus, createdAt
leadEventsby_location_createdAtlocationId, createdAt
clientHealthAlertsby_locationlocationId
clientHealthAlertsby_contactcontactId
clientHealthAlertsby_location_statuslocationId, status
processingTeamby_userIduserId
processingTeamby_emailemail
processingTeamby_activeisActive
processingConfigby_keykey
impersonationLogby_locationIdlocationId
impersonationLogby_contactIdcontactId
impersonationLogby_operatorEmailoperatorEmail
webhookEventsby_processedprocessed
webhookEventsby_reporepo
webhookEventsby_receivedAtreceivedAt
migrationMappingby_locationIdlocationId
migrationMappingby_statusstatus
migrationMappingby_emailclientEmail
autoCreditPullEventsby_decided_atdecidedAt
autoCreditPullEventsby_locationlocationId, decidedAt
autoCreditPullEventsby_outcomeoutcome, decidedAt
autoCreditPullEventsby_contactcontactId, decidedAt
autoCreditPullEventsby_contact_locationcontactId, locationId, decidedAt
prospectingCampaignsby_slugslug
prospectingCampaignsby_statusstatus
prospectingCampaignsby_createdAtcreatedAt
outreachShortLinksby_partner_templatepartnerId, template
outreachShortLinksby_slugslug
prospectingPartnersby_clerkUserIdclerkUserId
prospectingPartnersby_userIduserId
prospectingPartnersby_ghlLocationIdghlLocationId
prospectingPartnersby_stripeCustomerIdstripeCustomerId
prospectingPartnersby_stripeCheckoutSessionIdstripeCheckoutSessionId
prospectingPartnersby_statusstatus
prospectingPartnersby_emailcontactEmail
prospectingPartnersby_createdAtcreatedAt
prospectingPartnersby_outreachTeamoutreachTeamId
prospectingPartnersby_outreachTeam_verifiedoutreachTeamId, outreachVerifiedAt
prospectingPartnersby_status_createdAtstatus, createdAt
prospectingOutreachTeamsby_slugslug
prospectingOutreachTeamsby_ghlLocationIdghlLocationId
prospectingOutreachTeamsby_statusstatus
prospectingActivityby_partner_atpartnerId, at
prospectingActivityby_partner_kind_atpartnerId, kind, at
prospectingActivityby_campaign_atcampaignId, at
prospectingActivityby_lead_atleadId, at
prospectingActivityby_lead_kind_atleadId, kind, at
prospectingActivityby_atat
prospectingOutreachMessageReceiptsby_messageIdmessageId
prospectingOutreachMessageReceiptsby_lead_createdAtleadId, createdAt
prospectingAiReplyControlsby_contactpartnerId, ghlContactId
prospectingAiReplyControlsby_campaigncampaignId
prospectingAiReplyControlsby_partner_updatedAtpartnerId, updatedAt
prospectingAiReplyDraftsby_lead_updatedAtleadId, updatedAt
prospectingAiReplyDraftsby_status_updatedAtstatus, updatedAt
prospectingAiReplyDraftsby_contact_updatedAtpartnerId, ghlContactId, updatedAt
prospectingAiReplyDraftsby_campaign_updatedAtcampaignId, updatedAt
prospectingAiReplyDraftsby_inboundMessageIdinboundMessageId
prospectingLeadsby_partner_receivedpartnerId, receivedAt
prospectingLeadsby_partner_ghlContact_receivedpartnerId, ghlContactId, receivedAt
prospectingLeadsby_outreachTeamGhlContactIdoutreachTeamGhlContactId
prospectingLeadsby_partner_status_receivedpartnerId, status, receivedAt
prospectingLeadsby_statusstatus, receivedAt
prospectingLeadsby_campaign_receivedcampaignId, receivedAt
prospectingLeadsby_receivedAtreceivedAt
prospectingDeliveryLogby_lead_atleadId, at
prospectingDeliveryLogby_partner_atpartnerId, at
prospectingDeliveryLogby_partner_kind_atpartnerId, kind, at
prospectingDeliveryLogby_atat
prospectingAllocationsby_partner_monthpartnerId, month
prospectingAllocationsby_monthmonth
prospectingCouponsby_codecode
prospectingCouponsby_statusstatus, createdAt
prospectingVolumeCodesby_codecode
prospectingVolumeCodesby_statusstatus, createdAt
prospectingVolumeCodesby_partnerEmailpartnerEmail
prospectingLeadInvoiceTrackingby_statusstatus, updatedAt
prospectingLeadInvoiceTrackingby_partner_updatedAtpartnerId, updatedAt
prospectingLeadInvoiceTrackingby_leadleadId
prospectingLeadInvoiceTrackingby_invoiceghlInvoiceId
prospectingLeadInvoiceTrackingby_reconciledAtreconciledAt
automationLocationConfigby_locationIdlocationId
automationSettingsby_locationIdlocationId
automationSettingsby_locationId_and_triggerKeylocationId, triggerKey
automationSendsby_locationId_and_createdAtlocationId, createdAt
automationSendsby_reportIdreportId
automationSendsby_idempotencyKeyidempotencyKey
automationSendsby_locationId_and_triggerKey_and_createdAtlocationId, triggerKey, createdAt
businessQuestionnairesby_contactcontactId, locationId
prospectingReportRunsby_campaign_runAtcampaignId, runAt
prospectingReportRunsby_runAtrunAt
analyticsReportsby_locationlocationId
analyticsReportsby_location_dataSourcelocationId, dataSource
analyticsScheduledReportsby_enabled_nextRunAtenabled, nextRunAt
analyticsScheduledReportsby_locationlocationId
analyticsScheduledReportsby_reportreportId
analyticsReportFilesby_expiresAtexpiresAt
analyticsReportFilesby_locationlocationId
dataAccessSettingsby_locationlocationId
crmUserScopeCacheby_location_userlocationId, userId
crmUserScopeCacheby_locationlocationId
underwritingReviewLabelsby_requestId_createdAtrequestId, createdAt
underwritingReviewLabelsby_createdAtcreatedAt
underwritingReviewLabelsby_verdict_createdAtverdict, createdAt
underwritingReviewLabelsby_location_createdAtlocationId, createdAt
underwritingCalibrationProposalsby_createdAtcreatedAt
underwritingCalibrationProposalsby_status_createdAtstatus, createdAt
underwritingReviewFlagsby_status_createdAtstatus, createdAt
underwritingReviewFlagsby_requestIdrequestId
underwritingReviewFlagsby_category_statuscategory, status

B. Queries without .withIndex(...) (table-scan candidates)

File:LineTableSnippet
convex/admin/revertAutoApplicantPromotion.ts:102prospectingLeadsctx.db .query("prospectingLeads") .order("desc") .paginate({ cursor, numItems: PAGE })
convex/adminDashboard.ts:51ghlInstallationsctx.db.query("ghlInstallations").take(GLOBAL_REFERENCE_SCAN_CAP)
convex/adminDashboard.ts:52creditReportRequestsctx.db.query("creditReportRequests").take(GLOBAL_AGGREGATE_CAP)
convex/adminDashboard.ts:53underwritingResultsctx.db.query("underwritingResults").take(GLOBAL_AGGREGATE_CAP)
convex/adminDashboard.ts:54ghlSubscriptionsctx.db.query("ghlSubscriptions").take(GLOBAL_AGGREGATE_CAP)
convex/adminDashboard.ts:157ghlSubscriptionsctx.db.query("ghlSubscriptions").take(GLOBAL_AGGREGATE_CAP)
convex/adminDashboard.ts:172ghlInstallationsctx.db.query("ghlInstallations").take(GLOBAL_REFERENCE_SCAN_CAP)
convex/adminDashboard.ts:501ghlSubscriptionsctx.db.query("ghlSubscriptions").take(GLOBAL_AGGREGATE_CAP)
convex/adminDashboard.ts:602creditReportRequestsctx.db.query("creditReportRequests").order("desc").take(limit)
convex/adminDashboard.ts:625underwritingResultsctx.db.query("underwritingResults").order("desc").take(limit)
convex/adminDashboard.ts:651ghlSubscriptionsctx.db.query("ghlSubscriptions").order("desc").take(limit)
convex/adminDashboard.ts:677ghlInstallationsctx.db .query("ghlInstallations") .take(GLOBAL_REFERENCE_SCAN_CAP)
convex/adminDashboard.ts:806ghlInstallationsctx.db .query("ghlInstallations") .take(GLOBAL_REFERENCE_SCAN_CAP)
convex/adminInstallations.ts:15ghlInstallationsctx.db .query("ghlInstallations") .take(500)
convex/adminMetrics.ts:96ghlInstallationsctx.db.query("ghlInstallations").take(INSTALLATIONS_QUERY_LIMIT)
convex/adminMetrics.ts:98creditReportRequestsctx.db.query("creditReportRequests").take(STATS_QUERY_LIMIT)
convex/adminMetrics.ts:100underwritingResultsctx.db.query("underwritingResults").take(STATS_QUERY_LIMIT)
convex/adminMetrics.ts:102fundingPlansctx.db.query("fundingPlans").take(STATS_QUERY_LIMIT)
convex/adminMetrics.ts:172ghlInstallationsctx.db.query("ghlInstallations").take(INSTALLATIONS_QUERY_LIMIT)
convex/adminMetrics.ts:264ghlInstallationsctx.db.query("ghlInstallations").take(INSTALLATIONS_QUERY_LIMIT)
convex/adminMetrics.ts:275ghlSubscriptionsctx.db.query("ghlSubscriptions").take(STATS_QUERY_LIMIT)
convex/adminMetrics.ts:434ghlInstallationsctx.db.query("ghlInstallations").take(INSTALLATIONS_QUERY_LIMIT)
convex/adminMetrics.ts:743creditReportRequestsctx.db .query("creditReportRequests") .order("desc") .take(limit)
convex/adminMetrics.ts:773underwritingResultsctx.db .query("underwritingResults") .order("desc") .take(limit)
convex/adminMetrics.ts:1035creditReportRequestsctx.db .query("creditReportRequests") .order("desc") .take(limit)
convex/adminMetrics.ts:1064underwritingResultsctx.db .query("underwritingResults") .order("desc") .take(limit)
convex/adminMetrics.ts:1125ghlInstallationsctx.db .query("ghlInstallations") .order("desc") .take(INSTALLATIONS_QUERY_LIMIT)
convex/adminMetricsReads.ts:674ghlSubscriptionsctx.db .query("ghlSubscriptions") .take(SOURCE_QUERY_LIMIT)
convex/autoAssign.ts:33processingSubmissionsctx.db .query("processingSubmissions") .filter((q) => q.neq(q.field("assignedToUserId"), undefined)) .take(5000)
convex/autoAssign.ts:277processingTeamctx.db .query("processingTeam") .take(100)
convex/cards.ts:121cardsctx.db.query("cards").take(500)
convex/cards.ts:141cardsctx.db.query("cards").take(500)
convex/cards.ts:164cardsctx.db.query("cards").take(500)
convex/cards.ts:177cardsctx.db.query("cards").take(500)
convex/cards.ts:192cardsctx.db.query("cards").take(500)
convex/cards.ts:205cardsctx.db.query("cards").take(500)
convex/cards.ts:219cardsctx.db.query("cards").take(500)
convex/cards.ts:309cardsctx.db.query("cards").take(500)
convex/cards.ts:354cardsctx.db.query("cards").take(500)
convex/cards.ts:391cardsctx.db.query("cards").take(500)
convex/cards.ts:394fundingPlansctx.db.query("fundingPlans").take(500)
convex/checkInstallations.ts:9ghlInstallationsctx.db .query("ghlInstallations") .take(INSTALLATIONS_QUERY_LIMIT + 1)
convex/fundingPlans.ts:540fundingPlansctx.db.query("fundingPlans").take(ADMIN_PLAN_QUERY_LIMIT)
convex/fundingPlans.ts:688fundingPlansctx.db.query("fundingPlans").take(ADMIN_PLAN_QUERY_LIMIT)
convex/fundingPlans.ts:773fundingPlansctx.db.query("fundingPlans").take(ADMIN_PLAN_QUERY_LIMIT)
convex/fundingPlans.ts:875fundingPlansctx.db.query("fundingPlans").take(ADMIN_PLAN_QUERY_LIMIT)
convex/fundingPlans.ts:1480fundingPlansctx.db.query("fundingPlans").take(ADMIN_PLAN_QUERY_LIMIT)
convex/ghlInstallations.ts:294ghlInstallationsctx.db.query("ghlInstallations").take(10_000)
convex/globalSearch.ts:115processingSubmissionsctx.db.query("processingSubmissions").order("desc").take(scanLimit)
convex/globalSearch.ts:116fundingPlansctx.db.query("fundingPlans").order("desc").take(scanLimit)
convex/globalSearch.ts:117operatorInvoicesctx.db.query("operatorInvoices").order("desc").take(scanLimit)
convex/migrations.ts:1476ghlInstallationsctx.db.query("ghlInstallations").take(scanLimit)
convex/migrations/2026_05_18_provision_short_links.ts:98prospectingPartnersctx.db .query("prospectingPartners") .take(PARTNER_SCAN_CAP)
convex/migrations/2026_05_18_provision_short_links.ts:137prospectingPartnersctx.db .query("prospectingPartners") .take(PARTNER_SCAN_CAP)
convex/migrations/bulkFixCrmStagesHelpers.ts:15zohoDealsctx.db.query("zohoDeals")
convex/oneOffMigrations.ts:74creditReportRequestsctx.db .query("creditReportRequests") .paginate({ cursor: args.cursor ?? null, numItems: batchSize })
convex/oneOffMigrations.ts:140creditReportRequestsctx.db .query("creditReportRequests") .paginate({ cursor: args.cursor ?? null, numItems: batchSize })
convex/oneOffMigrations.ts:310prospectingPartnersctx.db .query("prospectingPartners") .paginate({ cursor: args.cursor ?? null, numItems: 200 })
convex/oneOffMigrations.ts:383underwritingResultsctx.db .query("underwritingResults") .paginate({ cursor: args.cursor ?? null, numItems: 500 })
convex/oneOffMigrations.ts:474prospectingPartnersctx.db .query("prospectingPartners") .paginate({ cursor: args.cursor, numItems: SEED_PAGE_SIZE })
convex/oneOffMigrations.ts:1539prospectingPartnersctx.db .query("prospectingPartners") .paginate({ cursor, numItems: CAMPAIGN_DELETE_PAGE_SIZE, })
convex/oneOffMigrations.ts:1675prospectingPartnersctx.db .query("prospectingPartners") .paginate({ cursor: args.cursor, numItems: Math.max(1, Math.min(args.numItems, 100)), })
convex/partnerReferralLinks.ts:23partnerReferralLinksctx.db .query("partnerReferralLinks") .filter((q) => q.eq(q.field("status"), "active")) .take(500)
convex/processingFees.ts:152processingFeesctx.db .query("processingFees") .order("desc") .take(PROCESSING_FEE_SCAN_CAP)
convex/processingFees.ts:184processingFeesctx.db .query("processingFees") .order("desc") .take(PROCESSING_FEE_SCAN_CAP)
convex/processingSubmissions.ts:101processingSubmissionsctx.db .query("processingSubmissions") .filter((q) => q.eq(q.field("contactId"), args.contactId)) .order("desc") .take(1)
convex/processingSubmissions.ts:242processingSubmissionsctx.db .query("processingSubmissions") .take(1000)
convex/processingSubmissions.ts:390processingSubmissionsctx.db .query("processingSubmissions") .take(1000)
convex/processingSubmissions.ts:1278processingSubmissionsctx.db .query("processingSubmissions") .paginate(args.paginationOpts)
convex/processingSubmissions.ts:1397processingSubmissionsctx.db .query("processingSubmissions") .paginate(args.paginationOpts)
convex/processingSubmissions.ts:1523processingSubmissionsctx.db .query("processingSubmissions") .paginate(args.paginationOpts)
convex/prospecting/outreachTeamsAdmin.ts:101prospectingOutreachTeamsctx.db.query("prospectingOutreachTeams").take(100)
convex/salesCommissions.ts:285salesCommissionsctx.db .query("salesCommissions") .order("desc") .take(limit)
convex/stitchCreditTokens.ts:15stitchCreditTokensctx.db .query("stitchCreditTokens") .order("desc") .first()
convex/stitchCreditTokens.ts:45stitchCreditTokensctx.db .query("stitchCreditTokens") .order("desc") .first()
convex/underwriting.ts:1060ghlInstallationsctx.db.query("ghlInstallations").take(100)
convex/underwriting.ts:2517underwritingResultsctx.db.query("underwritingResults").take(8000)
convex/zohoVerticalAccounts.ts:113zohoVerticalAccountsctx.db .query("zohoVerticalAccounts") .order("desc") .take(limit)
Note: a query() without .withIndex(...) is not always a bug — it may be intentionally fetching a single doc by id or operating on a tiny table (get, unique, first, etc.). Treat this list as a triage queue, not a defect list.

C. Missing table-scoped index references

Each .withIndex("name") below is checked against the indexes declared on that exact ctx.db.query("table") table. None detected.

D. Unbounded .collect() locations

“Unbounded” = a .collect() with no preceding .withIndex(...) and no .take(N) in the same chain. These walk the entire table. None detected.
Re-run with bun run scripts/audit-convex-indexes.ts. The JSON sidecar at the same path is available for follow-up tooling (e.g. piping into Linear, an annotated diff, or a custom reporter).