optional "compress labels" compiler behavior

Issue #1211 resolved
Mike Bayer repo owner created an issue

this is an interesting feature which I have working. I would like to see if this might be an optional feature, or also if it suggests refinements to the inner workings of long label names and such. The attached patch illustrates the basic idea. a statement which now compiles as:

SELECT anon_1.name AS anon_1_name FROM (SELECT users.id AS id, users.name AS name FROM users WHERE users.id IN (?, ?)) AS anon_1

becomes:

SELECT anon_1._2 AS _1 \nFROM (SELECT users.id AS _2, users.name AS _3 \nFROM users \nWHERE users.id IN (?, ?)) AS anon_1

the key is that it looks at a given column slightly more intelligently (adds a speed hit at the moment which maybe can be refined) to determine if its derived or real. We can tell if a derived column is going to be labeled or not using logic similar to label_select_column(), and perhaps that logic can be rolled into some kind of cache.

Comments (2)

  1. Log in to comment