Skip to main content
added 2093 characters in body
Source Link
uberrebu
  • 471
  • 1
  • 7
  • 12
added 20 characters in body
Source Link
uberrebu
  • 471
  • 1
  • 7
  • 12
id  select_type table   partitions  type    possible_keys   key key_len ref rows    filtered    Extra
1   SIMPLE  django_session  NULL    ALL NULL  range  NULL last_login  last_login NULL 5   NULL    24209837 1   33100.3300  Using where; Using whereindex
id  select_type table   partitions  type    possible_keys   key key_len ref rows    filtered    Extra
1   SIMPLE  django_session  NULL    ALL NULL    NULL    NULL    NULL    24209837    33.33   Using where
id  select_type table   partitions  type    possible_keys   key key_len ref rows    filtered    Extra
1   SIMPLE  django_session  NULL    range   last_login  last_login  5   NULL    1   100.00  Using where; Using index
added 336 characters in body
Source Link
uberrebu
  • 471
  • 1
  • 7
  • 12

UPDATE v2: (after running ALTER TABLE django_session ADD KEY (last_login))

EXPLAIN SELECT COUNT(*) FROM django_session WHERE django_session.last_login >= '2019-03-04 13:00:37'

id  select_type table   partitions  type    possible_keys   key key_len ref rows    filtered    Extra
1   SIMPLE  django_session  NULL    ALL NULL    NULL    NULL    NULL    24209837    33.33   Using where

UPDATE v2: (after running ALTER TABLE django_session ADD KEY (last_login))

EXPLAIN SELECT COUNT(*) FROM django_session WHERE django_session.last_login >= '2019-03-04 13:00:37'

id  select_type table   partitions  type    possible_keys   key key_len ref rows    filtered    Extra
1   SIMPLE  django_session  NULL    ALL NULL    NULL    NULL    NULL    24209837    33.33   Using where
added 304 characters in body
Source Link
uberrebu
  • 471
  • 1
  • 7
  • 12
Loading
Source Link
uberrebu
  • 471
  • 1
  • 7
  • 12
Loading