Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Must....not....kill....

Must....not....kill....

Scheduled Pinned Locked Moved The Weird and The Wonderful
pythoncomperformancelearning
26 Posts 18 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Marc Clifton

    a = cx.ExecuteQuery("select top (1) a from foo where id={0}", id).First();
    b = cx.ExecuteQuery("select top (1) b from foo where id={0}", id).First();
    c = cx.ExecuteQuery("select top (1) c from foo where id={0}", id).First();

    ... and about 20 more of those, yes, each effectively querying a scalar from foo with the same qualifier. Major redaction in the above, but you get the idea. So many things wrong about this. And people here wonder why the performance of nightly jobs is so bad. :((

    Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

    E Offline
    E Offline
    englebart
    wrote on last edited by
    #21

    Maybe it started as 20 separate tables each with a single column? DBA came along and joined the tables together, so the devs did the obvious refactor?

    1 Reply Last reply
    0
    • M Marc Clifton

      a = cx.ExecuteQuery("select top (1) a from foo where id={0}", id).First();
      b = cx.ExecuteQuery("select top (1) b from foo where id={0}", id).First();
      c = cx.ExecuteQuery("select top (1) c from foo where id={0}", id).First();

      ... and about 20 more of those, yes, each effectively querying a scalar from foo with the same qualifier. Major redaction in the above, but you get the idea. So many things wrong about this. And people here wonder why the performance of nightly jobs is so bad. :((

      Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

      A Offline
      A Offline
      agolddog
      wrote on last edited by
      #22

      When you refactor, make sure to return the collection as a DataRow so that annoying strong-typing gets eliminated. ;)

      1 Reply Last reply
      0
      • M Marc Clifton

        Tomaž Štih wrote:

        I think this is the guy you're looking for.

        Tools don't create bad code, it's the person wielding the tool!

        Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

        T Offline
        T Offline
        Tomaz Stih 0
        wrote on last edited by
        #23

        That's what I always say about guns. :cool:

        1 Reply Last reply
        0
        • M Marc Clifton

          a = cx.ExecuteQuery("select top (1) a from foo where id={0}", id).First();
          b = cx.ExecuteQuery("select top (1) b from foo where id={0}", id).First();
          c = cx.ExecuteQuery("select top (1) c from foo where id={0}", id).First();

          ... and about 20 more of those, yes, each effectively querying a scalar from foo with the same qualifier. Major redaction in the above, but you get the idea. So many things wrong about this. And people here wonder why the performance of nightly jobs is so bad. :((

          Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

          K Offline
          K Offline
          KBZX5000
          wrote on last edited by
          #24

          This is were the Warhammer 40K universe gets it right, I think. They lobotomize and reeducate people like that. Clean, cost effective, ecological. I've pitched a similar idea, but marketing disagrees every time I propose to stab people. The numbers check out though; the reduction in technical debt and project costs is significant, even if you reallocate resource to pay for the funerals.

          1 Reply Last reply
          0
          • M Marc Clifton

            a = cx.ExecuteQuery("select top (1) a from foo where id={0}", id).First();
            b = cx.ExecuteQuery("select top (1) b from foo where id={0}", id).First();
            c = cx.ExecuteQuery("select top (1) c from foo where id={0}", id).First();

            ... and about 20 more of those, yes, each effectively querying a scalar from foo with the same qualifier. Major redaction in the above, but you get the idea. So many things wrong about this. And people here wonder why the performance of nightly jobs is so bad. :((

            Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

            I Offline
            I Offline
            irneb
            wrote on last edited by
            #25

            Only the two options? To kill or not to kill? Nah! I want a bit of torture first! You know, just to get my mental stability back before they die!

            1 Reply Last reply
            0
            • M Marc Clifton

              a = cx.ExecuteQuery("select top (1) a from foo where id={0}", id).First();
              b = cx.ExecuteQuery("select top (1) b from foo where id={0}", id).First();
              c = cx.ExecuteQuery("select top (1) c from foo where id={0}", id).First();

              ... and about 20 more of those, yes, each effectively querying a scalar from foo with the same qualifier. Major redaction in the above, but you get the idea. So many things wrong about this. And people here wonder why the performance of nightly jobs is so bad. :((

              Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

              C Offline
              C Offline
              C Pottinger
              wrote on last edited by
              #26

              I don't get it ! ! ! Why must you 'not kill'? It seems justified.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups