Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-932

Methods for processing large data amounts from database

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.3
    • Fix Version/s: 5.2.0-B1
    • Component/s: Database
    • Labels:
      None

      Description

      In-Portal nice [b]$this->Application->Conn->Query[/b] method, that accepts SQL and returns an array of data to used right away. This proved very useful for small sets of data.

      However, when you need to process 2000 or more records, then this method will eat up a lot of memory while transforming sql result into PHP array.

      Attached methods contains kDBConnection::QueryRaw and kDBConnection::GetNextRow methods, that basically does the same what mysql_query and mysql_fetch_assoc methods. Also kDBConnection::Destroy method was changed to accept incoming recordset resource, that needs to be destroyed.

      Here is usage example:

      $rs = $this->Conn->QueryRaw($sql);

      while ( $row = $this->Conn->GetNextRow($rs) )

      { echo $row['userid']; echo $row['fullname']; echo $row['userstatus']; }

      $this->Conn->Destroy($rs);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: