Skip to main content

Posts

Showing posts from 2020

Optimizing MySQL Queries: A Deep Dive into Indexing and STRAIGHT_JOIN

When working with MySQL, optimizing query performance is crucial. Before finalizing my queries, I always use MySQL Workbench to explain the query plan, ensuring optimal performance. However, I’ve noticed that performance can vary, especially with queries involving joins on multiple tables. Indexing my tables often helps, but sometimes even with appropriate indexes, the expected performance boost isn’t there. Recently, I encountered a query that wasn’t performing well despite adding the right index. MySQL Workbench revealed that MySQL wasn’t using the new index. After some experimentation, I found that using FORCE INDEX made MySQL utilize the index. However, forcing MySQL to use an index didn’t feel like the best solution. I wanted MySQL to optimize the query automatically. Discovering STRAIGHT_JOIN During my research, I came across STRAIGHT_JOIN . Adding this to my query immediately made MySQL use the index without any force. This led me to explore the differences between STRAIGHT_JOI...

Automate File Transfer to Remote Server Using Ant Build in Eclipse

Automate File Transfer to Remote Server Using Ant Build in Eclipse Working on a project often involves copying files to a remote server. Manually transferring files via SFTP tools can be tedious and time-consuming. During one such project, I wondered if Ant Builder, which is capable of copying files between directories, could also handle copying files to a remote server. After some research and experimentation, I found a solution that works perfectly. Now, my local files are automatically copied to a remote server using Ant Build. I simply build my project in Eclipse, and the files are pushed to the server. All that’s left is to refresh the web page, as the server development environment seamlessly integrates with my local setup. Step-by-Step Guide to Copy Files to a Remote Server Using Ant Build 1. Download the Necessary JAR File First, download the jsch-0.1.55.jar file, which enables secure file transfer. 2. Add the JAR to Eclipse Add the jsch-0.1.55.j...