Changes between Initial Version and Version 1 of Ticket #35399, comment 8


Ignore:
Timestamp:
Apr 24, 2024, 2:45:27 PM (7 months ago)
Author:
Willem Van Onsem

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35399, comment 8

    initial v1  
    22
    33But probably the main reason why it would be very strange that the hashing would increase time significantly is that in order to generate an SQL counterpart of some expression (like F('a') + Value(1)`, it will *also* take linear). So essentially *building* the SQL query with *all* `Case` / `When` items, will always take approximately the same effort as hashing all these items, since both run linear in the "size" of the SQL expressions (or at least, that is a reasonable assumption), so we will lose that effort anyway. It will thus probably at most ~double the amount of effort to generate the query, if there are (close) to no duplicate expressions available, and my experience is that building the query itself, often is not really the bottleneck: once to generate the hashes, and once to generate the query. If there are duplicate expressions, it saves also on generate parts of the SQL query, which again will probably not have much impact in a positive or negative way, since that is almost never the bottleneck.
     4
     5I will try to run some benchmarks with `F('scans_in') + Value(random.randint(0, 10))` expressions tomorrow.
Back to Top