Implementation of count(*) in MySQL
Different MySQL engines implement count(*) in varied ways
Implementation of count(*) in MySQLDifferent MySQL engines implement count(*) in varied ways:
MyISAM
MyISAM engine stores the total row count of a table on the disk. When executing count(*), it directly returns this number, ensuring high efficiency.
InnoDB
InnoDB’s approach is more complex. When executing count(*), it has to read each row of data from the engine and count accumulatively.
InnoDB organizes data in an index-oriented way. T ...
Database Table Space Reclamation
Database Table Space ReclamationTable Storage Location
The table data storage location is controlled by the parameter innodb_file_per_table.
OFF: Table data is stored in the system’s shared tablespace, i.e., alongside the data dictionary.
ON: Each InnoDB table data is stored in an individual file with a .ibd suffix.
Note: Starting from MySQL version 5.6.6, the default value is set to ON. It is recommended to set this parameter to ON because managing individual files for each table is more ...
MySQL Update Processes and Transaction Management
MySQL is a widely-used relational database management system (RDBMS). Understanding its update processes and transaction management is crucial for ensuring data consistency and system optimization.
MySQL Update Processes and Transaction ManagementMySQL is a widely-used relational database management system (RDBMS). Understanding its update processes and transaction management is crucial for ensuring data consistency and system optimization.
Update Process
Connect to the DatabaseEstablish a conn ...
MySQL Locking Mechanisms
Database locks are essential for handling concurrency issues. With databases serving as multi-user shared resources, it’s imperative to manage access ensuring data consistency and integrity.
MySQL Locking MechanismsDatabase locks are essential for handling concurrency issues. With databases serving as multi-user shared resources, it’s imperative to manage access ensuring data consistency and integrity.
Types of LocksIn MySQL, locks can be broadly categorized into:
Global Locks
Table-level Loc ...
Change Buffer
InnoDB has a strategic approach when it comes to updating a data page.
Understanding InnoDB’s Change BufferInnoDB has a strategic approach when it comes to updating a data page:
If the data page is already in memory, it updates directly in the memory.
If the data page isn’t in memory, and the update doesn’t violate data consistency, then InnoDB caches this update in the change buffer. This means it doesn’t have to fetch the data page from the disk right away. When the data page is accessed la ...
NAV Web Service Programming Resources
Here are some of the resources I found helpful for learning to develop Dynamics NAV web service based applications.
C/AL Programming:Introduction to CAL ProgrammingThis provides a good overview of the basics of CAL programming, which can become necessary in building a web service applications when a custom codeunit or page extension is required.
Setting up Web Services:Vjecko Web Service Recorded SessionVjecko.com has a lot of detailed articles about web service programming, but this older ...
Adding Lookup Field to a Page in Dynamics NAV
One of the problems I faced in building a non-trivial application that consumedNAV Web Services was figuring out how to “join” fields from different tables.For example, when exposing a list of jobs from a job table which includes aresource needed for the job, you might need more than just the resource idthat’s a field in the table: you might also need the resource name anddescription. While this is easy to get for one record, what about when youneed a few hundred records in a table that has bee ...
Static NGINX1 Locations
I try to get a lot of mileage out of the single AWS t2.micro instance I keep running,which means I have many different projects running on different paths on a single server. Everytime I finish a project, I have to relearn how to add new “locations” (paths) to the NGINX virtual host.
I was really frustrated when I couldn’t figure out how to add a static location for the Jekyllwebsite I created for the game I’m developing. I kept trying to do something like this:
location / {
root /home/ ...
Spaces for Newline Indents in VS
It’s really annoying when Visual Studio shows you this:
But github or vim shows you the same file like this:
If you use the “show whitespace” Visual Studio chord (CTRL-R, CTRL-W),you’ll see that visual studio inserts tabs instead of spaces bydefault for newline indent:
Visual Studio displays tabs as having the samewidth as four spaces. But if you’re collaborating with someone workingin another text editor like vim, your automatically-inserted tabs willappear larger than four spaces.
Here ...