else:
                schedulable_ti_ids.append((ti.task_id, ti.map_index))
        count = 0
        if schedulable_ti_ids:
            schedulable_ti_ids_chunks = chunks(
                schedulable_ti_ids, max_tis_per_query or len(schedulable_ti_ids)
            )
            for schedulable_ti_ids_chunk in schedulable_ti_ids_chunks:
                count += (
                    session.query(TI)
                    .filter(
                        TI.dag_id == self.dag_id,
                        TI.run_id == self.run_id,
                        tuple_in_condition((TI.task_id, TI.map_index), schedulable_ti_ids_chunk),
                    )
                    .update({TI.state: State.SCHEDULED}, synchronize_session=False)
                )
        
        if dummy_ti_ids:
            dummy_ti_ids_chunks = chunks(dummy_ti_ids, max_tis_per_query or len(dummy_ti_ids))
            for dummy_ti_ids_chunk in dummy_ti_ids_chunks:
                count += (
                    session.query(TI)
                    .filter(
                        TI.dag_id == self.dag_id,
                        TI.run_id == self.run_id,
                        TI.task_id.in_(dummy_ti_ids_chunk),
                    )
                    .update(
                        {