Menu

#2709 (ok 2.11.8) sql file import very slow on Windows

fixed
1
2013-06-11
2008-06-11
No

Since 2.11.3 importing sql has been very slow and invariably times out. A test file with only 27 queries takes 22 seconds to complete.

I have traced the issue to line 118 of libraries\import\sql.php

$p8 = stripos($buffer, 'DELIMITER', $i);

Changing to stripos to strpos reduces the import time for my test file to a sensible 2 seconds.

The problem is occuring only on my Windows machine (IIS/5.1 with php 5.26 CGI/FastCGI) but is fine on my Linux server.

I realise that stripos is a new command in php5+ but for some reason it is adding a massive overhead to this process.

Discussion

  • Marc Delisle

    Marc Delisle - 2008-06-11

    Logged In: YES
    user_id=210714
    Originator: NO

    It would be great if you could attach your test file. I'll retest on Windows (I hope the bug happens under Apache too). I think we still need to check for both cases (delimiter/DELIMITER) but this could be done with another logic.

     
  • Richard Heaton

    Richard Heaton - 2008-06-11

    Logged In: YES
    user_id=2114158
    Originator: YES

    This does not happen on my Linux/Apache server only on Windows IIS 5.1

    The file is database tables exported with pma. I have removed customer data and attached.

    With stripos changed to strpos this imports in 2 seconds. But with stripos it takes 23 seconds
    File Added: test.sql

     
  • Richard Heaton

    Richard Heaton - 2008-06-11
     
  • Marc Delisle

    Marc Delisle - 2008-06-13
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2008-06-13
    • summary: sql file import very slow --> sql file import very slow on IIS
     
  • Marc Delisle

    Marc Delisle - 2008-06-13

    Logged In: YES
    user_id=210714
    Originator: NO

    Confirmed on: Windows + IIS + PHP 5.1.0 (CGI/FastCGI)
    Confirmed on: Windows + Apache + PHP 5.2.5

     
  • Marc Delisle

    Marc Delisle - 2008-06-13
    • summary: sql file import very slow on IIS --> sql file import very slow on Windows
     
  • Marc Delisle

    Marc Delisle - 2008-06-13

    Logged In: YES
    user_id=210714
    Originator: NO

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2008-06-13
    • priority: 5 --> 1
    • summary: sql file import very slow on Windows --> (ok 2.11.8) sql file import very slow on Windows
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2008-06-13

    Logged In: YES
    user_id=210714
    Originator: NO

    Reported as a PHP 5.2.6 bug:
    http://bugs.php.net/bug.php?id=45265

     
  • Marc Delisle

    Marc Delisle - 2008-07-28
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed