mysql - PHP memory leak from a information schema query -


i have application i'm querying large table of zip code information. table has 41143 rows of information. application built in laravel , i'm using db facade selects.

i'm building paging structure wanted able total number of rows can determine how many pages there given number of output rows user wants see.

when tried first query, select count(*) zipcodes got php memory error (not ultra surprising).

i changed query following:

select table_rows information_schema.tables table_schema = "zipcodes" 

considering table_rows column in information schema 1 number thought wouldn't take time @ pull, same error:

php fatal error: allowed memory size of 134217728 bytes exhausted (tried allocate 32 bytes) ...

why query against information_schema table cause memory leak?

i should add that:

  • i tried selecting number of things information_schema table query , got same error
  • when try same querying db facade structure use zipcodes table directly (and limit query) don't receive memory error.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -