 
             if event?.which isnt 9 # has to be before create_suggestion()
                 @cursor_for_auto_completion = @codemirror.getCursor()
+
+            # The expensive operations are coming. If the query is too long, we just don't parse the query
+            if @codemirror.getValue().length > @max_size_query
+                return false
+
             # We just look at key up so we don't fire the call 3 times
             if event?.type? and event.type isnt 'keyup' and event.which isnt 9 and event.type isnt 'mouseup'
                 return false

                                        element.type = 'var'
                                        element.name = result_regex[0].slice(0, position_opening_parenthesis)
                                        stack.push element
                                        element =
                                            type: 'function'
                                            name: '('

            @codemirror = CodeMirror.fromTextArea document.getElementById('input_query'),
                mode:
                    name: 'javascript'
                onKeyEvent: @handle_keypress
                lineNumbers: true
                lineWrapping: true
                matchBrackets: true
                tabSize: 2

            @codemirror.on 'blur', @on_blur
            @codemirror.on 'gutterClick', @handle_gutter_click

