MySQL Query Takes Too Long.

Posted on 2012-08-15
Last Modified: 2012-08-15
This query runs quickly in MSSQL, however extremely slow in MySQL. Help!

INSERT INTO Archives (DateIn, `Priority`
(SELECT DateIn, `Priority`
 FROM Logs s
 JOIN Ports p on p.Port = s.Port And p.Secured = '1'
 Where Not Exists (Select DateIn From Users Where DateIn = s.DateIn))

 -- or --

Where DateIn Not In (Select DateIn From Users))
Question by:pointeman
    LVL 8

    Accepted Solution

    What fields do you have your indexes built on.  At the least you need indexes on the fields you join and in your where clauses.

    Author Closing Comment

    Created index on both tables for Join purposes, thx

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now