MySQL Forums
Forum List  »  Performance

Re: speed up query
Posted by: Rick James
Date: April 18, 2010 05:40PM

SHOW TABLE STATUS -- I need to see how big these tables are.
Please use aliases on all field when you have JOINs (srnup).
Is there some reason for the ids to be NULLable?
How many rows in dsl_data are there for a typical day & port_id?
Minor bug: BETWEEN is causing you to have midnight in two days.
"int(3)" should probably be TINYINT UNSIGNED (4 bytes -> 1 byte)

  PRIMARY KEY (`id`),
  KEY `idx_site_ip_id` (`id`),
The second is redundant an probably should be removed.

Changing
KEY `idx_dsl_data_port_id` (`port_id`)
to the compound key:
INDEX (`port_id`, time)
would help some.

Options: ReplyQuote


Subject
Views
Written By
Posted
4145
April 18, 2010 06:42AM
1512
April 18, 2010 04:04PM
Re: speed up query
1592
April 18, 2010 05:40PM
1317
April 27, 2010 02:29PM
1464
April 27, 2010 07:59PM
1321
April 28, 2010 12:12AM
1581
April 28, 2010 06:22AM
1524
April 29, 2010 01:03AM
1379
April 29, 2010 02:17AM
1384
April 29, 2010 08:19AM
1387
April 29, 2010 09:18AM
1315
April 30, 2010 12:30AM
1570
April 30, 2010 07:47AM
1487
April 30, 2010 08:21AM
1399
April 30, 2010 10:08AM
1321
May 01, 2010 02:34AM
1337
May 01, 2010 09:54AM
1289
May 01, 2010 10:48AM
1418
May 01, 2010 02:20PM
1357
May 02, 2010 03:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.