Loading ...
Sorry, an error occurred while loading the content.

Re: TAFFY() subset

Expand Messages
  • taffydb-owner@yahoogroups.com
    Jason, If I understand what you are asking then Taffy is already somewhat effective at sun queries. It works by reducing the number of records it looks at to
    Message 1 of 7 , Aug 17 9:54 AM
    • 0 Attachment
      Jason,

      If I understand what you are asking then Taffy is already somewhat effective at sun queries. It works by reducing the number of records it looks at to only those that passed the previous filters.

      Example:
      db({status:['active','pending','pause']}).filter({priority:1}).filter({managed:true}).get()

      So it will filter for records with one of those 3 statuses first and then searches the results for priority 1 and then searches those results for managed = true.

      Also, can't you just do this yourself by calling TAFFY(db().get())?

      It wouldn't really cause any issues other than all the records would get new ___ids so you couldn't take any of them and pass them back to the original db() to update or remove, etc

      Thought?

      Ian



      --- In taffydb@yahoogroups.com, Jason Wright <jasonwright365@...> wrote:
      >
      > Ian,
      >
      > When using a .filter([key:value]).get() command, the resulting subset is an
      > array of values.
      > Instead of returning an array of values, is it possible to return a new
      > TAFFY() database composed of the selected subset subset?
      > Some of my more detailed queries might be faster if the result is a new
      > TAFFY() database.
      >
      > thanks,
      > -Jason
      >
    • Jason Wright
      TAFFY(db().get()) That s exactly what I was wanting. Basically, in my financial planning software, I have a lot of data that I need to access, but the order of
      Message 2 of 7 , Aug 17 12:08 PM
      • 0 Attachment
        TAFFY(db().get()) 

        That's exactly what I was wanting. Basically, in my financial planning software, I have a lot of data that I need to access, but the order of the information processed matters. By creating a new temporary database, I can query and save the information for a particular date, then I can query the subset in the order that I am defining for my different types of data for that date. This saves me from processing a lot of queries on the larger dataset or from iterating multiple times through a big list of results in an array. 

        thanks!
        -Jason

        On Fri, Aug 17, 2012 at 10:54 AM, <taffydb-owner@yahoogroups.com> wrote:
         

        Jason,

        If I understand what you are asking then Taffy is already somewhat effective at sun queries. It works by reducing the number of records it looks at to only those that passed the previous filters.

        Example:
        db({status:['active','pending','pause']}).filter({priority:1}).filter({managed:true}).get()

        So it will filter for records with one of those 3 statuses first and then searches the results for priority 1 and then searches those results for managed = true.

        Also, can't you just do this yourself by calling TAFFY(db().get())?

        It wouldn't really cause any issues other than all the records would get new ___ids so you couldn't take any of them and pass them back to the original db() to update or remove, etc

        Thought?

        Ian



        --- In taffydb@yahoogroups.com, Jason Wright <jasonwright365@...> wrote:
        >
        > Ian,
        >
        > When using a .filter([key:value]).get() command, the resulting subset is an
        > array of values.
        > Instead of returning an array of values, is it possible to return a new
        > TAFFY() database composed of the selected subset subset?
        > Some of my more detailed queries might be faster if the result is a new
        > TAFFY() database.
        >
        > thanks,
        > -Jason
        >


      • Jason Wright
        Thinking about the situation a little more, if I didn t want to use a subdatabase, I could use a special code to describe the order of the operation, then
        Message 3 of 7 , Aug 17 12:29 PM
        • 0 Attachment
          Thinking about the situation a little more, if I didn't want to use a subdatabase, I could use a special code to describe  the order of the operation, then sort on this code... so many different ways to do the same thing.

          -Jason

          On Fri, Aug 17, 2012 at 1:08 PM, Jason Wright <jasonwright365@...> wrote:
          TAFFY(db().get()) 

          That's exactly what I was wanting. Basically, in my financial planning software, I have a lot of data that I need to access, but the order of the information processed matters. By creating a new temporary database, I can query and save the information for a particular date, then I can query the subset in the order that I am defining for my different types of data for that date. This saves me from processing a lot of queries on the larger dataset or from iterating multiple times through a big list of results in an array. 

          thanks!
          -Jason


          On Fri, Aug 17, 2012 at 10:54 AM, <taffydb-owner@yahoogroups.com> wrote:
           

          Jason,

          If I understand what you are asking then Taffy is already somewhat effective at sun queries. It works by reducing the number of records it looks at to only those that passed the previous filters.

          Example:
          db({status:['active','pending','pause']}).filter({priority:1}).filter({managed:true}).get()

          So it will filter for records with one of those 3 statuses first and then searches the results for priority 1 and then searches those results for managed = true.

          Also, can't you just do this yourself by calling TAFFY(db().get())?

          It wouldn't really cause any issues other than all the records would get new ___ids so you couldn't take any of them and pass them back to the original db() to update or remove, etc

          Thought?

          Ian



          --- In taffydb@yahoogroups.com, Jason Wright <jasonwright365@...> wrote:
          >
          > Ian,
          >
          > When using a .filter([key:value]).get() command, the resulting subset is an
          > array of values.
          > Instead of returning an array of values, is it possible to return a new
          > TAFFY() database composed of the selected subset subset?
          > Some of my more detailed queries might be faster if the result is a new
          > TAFFY() database.
          >
          > thanks,
          > -Jason
          >



        • Karl Coleman
          Here s the query I m doing, with the details removed. Pretty basic. The db has 1060 records, nothing crazy large IMO. records = db().join(teams,
          Message 4 of 7 , Aug 28 12:15 PM
          • 0 Attachment
            Here's the query I'm doing, with the details removed. Pretty basic. The
            db has 1060 records, nothing crazy large IMO.

            records = db().join(teams, function(l,r){}).join(players,
            function(l,r){)).order()limit().select()

            I'm doing a loop and each iteration performing the above query with a
            different criterion. Usually on the 5th iteration it freezes. Sometimes
            on the 4th, but it never makes it through the 5th.

            Each iteration I process the returned records, creating a data structure
            to be used by jquery templates.

            I can't figure out what's going on. Is there some data/memory management
            I should be doing with the db before each iteration? There're no errors
            in the JS console. It's just frozen. And the criteria doesn't matter.
            It's always the 4th or 5th, usually the 5th, iteration that it gets
            frozen on.

            Thanks,
            Karl
          • Karl
            Still trying to figure out my last problem. Throwing stuff against the wall to see what sticks at this point. What s the difference between
            Message 5 of 7 , Aug 31 5:00 AM
            • 0 Attachment
              Still trying to figure out my last problem. Throwing stuff against the wall to see what sticks at this point.

              What's the difference between

              db({col4:value}).order("col2");

              and

              db().filter({col4:value}).order("col2");

              Thanks,
              Karl

              --- In taffydb@yahoogroups.com, Karl Coleman <karlcoleman@...> wrote:
              >
              > Here's the query I'm doing, with the details removed. Pretty basic. The
              > db has 1060 records, nothing crazy large IMO.
              >
              > records = db().join(teams, function(l,r){}).join(players,
              > function(l,r){)).order()limit().select()
              >
              > I'm doing a loop and each iteration performing the above query with a
              > different criterion. Usually on the 5th iteration it freezes. Sometimes
              > on the 4th, but it never makes it through the 5th.
              >
              > Each iteration I process the returned records, creating a data structure
              > to be used by jquery templates.
              >
              > I can't figure out what's going on. Is there some data/memory management
              > I should be doing with the db before each iteration? There're no errors
              > in the JS console. It's just frozen. And the criteria doesn't matter.
              > It's always the 4th or 5th, usually the 5th, iteration that it gets
              > frozen on.
              >
              > Thanks,
              > Karl
              >
            • Rory Barrett
              Hello Colleagues I have been playing around with Taffy and am impressed. How does Taffy read from a csv table with say 50 records ? Rory Barrett
              Message 6 of 7 , Sep 21, 2012
              • 0 Attachment
                Hello Colleagues
                 
                I have been playing around with Taffy and am impressed. How does Taffy read from a csv table with say 50 records ?
                 
                Rory Barrett
              Your message has been successfully submitted and would be delivered to recipients shortly.