Project

General

Profile

« Previous | Next » 

Revision 1989

bin/map: Only turn on by_col optimization if mapping to same DB, rather than requiring each place that checks by_col to also check whether mapping to same DB

View differences:

bin/map
75 75
    end = n
76 76
    if end != None: end += start
77 77
    
78
    # Optimization
79
    by_col = opts.env_flag('by_col', False, env_names)
80
    if test: cpus_default = 0
81
    else: cpus_default = None
82
    cpus = util.cast(int, util.none_if(opts.get_env_var('cpus', cpus_default,
83
        env_names), u''))
84
    
85 78
    # Debugging
86 79
    debug = opts.env_flag('debug', False, env_names)
87 80
    sql.run_raw_query.debug = debug
......
98 91
    in_schema = opts.get_env_var('in_schema', None, env_names)
99 92
    in_table = opts.get_env_var('in_table', None, env_names)
100 93
    
94
    # Optimization
95
    by_col = in_db_config == out_db_config and opts.env_flag('by_col', False,
96
        env_names) # by-column optimization only applies if mapping to same DB
97
    if test: cpus_default = 0
98
    else: cpus_default = None
99
    cpus = util.cast(int, util.none_if(opts.get_env_var('cpus', cpus_default,
100
        env_names), u''))
101
    
101 102
    ##
102 103
    
103 104
    # Logging
......
262 263
                table = sql.qual_name(in_db, schema, table)
263 264
                table_is_esc = True
264 265
            
265
            if by_col and in_db_config == out_db_config:
266
            if by_col:
266 267
                # Mapping to same DB and by-column optimization enabled
267 268
                raise NotImplementedError(
268 269
                    'By-column optimization not available yet')

Also available in: Unified diff