Re: Revisited: Working with a billion rows
Posted by: Rick James
Date: December 08, 2012 12:59PM

The JOIN version of the SELECT is definitely the better one. It is probably something subtle that is making it run so slow.

Please provide SHOW CREATE TABLE and SHOW TABLE STATUS for each table.

> record like "1%"
Is `record` a VARCHAR? What percent of the total number of rows match '1%'?

If `record` is INT, then use a numeric comparison, such as
record >= 1000 AND record < 2000
Otherwise, the optimizer gives up and scans the entire table.

Turn that DELETE into a SELECT (JOINing the two tables); then let's discuss how to optimize the SELECT.

> Production queries will be very few - maybe 10 per day - but they'll need to be quick.
While you are at it, show us those SELECTs.

Options: ReplyQuote


Subject
Written By
Posted
Re: Revisited: Working with a billion rows
December 08, 2012 12:59PM


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.