Catatan

Tunjukkan catatan dari 2025

MSSQL behaviour loves to eat RAM πŸͺ

 ⚠️ Understanding SQL Server Memory Management SQL Server Memory Usage: SQL Server does not immediately release memory even if tables are truncated or data is deleted. Memory Retention Mechanism: By design, SQL Server retains memory (buffer pool, plan cache) for performance reasons. Memory Clearing is Manual: Reducing SQL Server's memory usage must be done explicitly. Solution: Clear SQL Server Memory Manually To manually clear SQL Server memory and force it to release unused memory: 1. Clear the Buffer Cache DBCC DROPCLEANBUFFERS; 2. Clear the Plan Cache DBCC FREEPROCCACHE; 3. Clear Cache for Specific Database (Recommended) USE [syncdb]; DBCC FREEPROCCACHE WITH NO_INFOMSGS; DBCC DROPCLEANBUFFERS WITH NO_INFOMSGS; Solution: Adjust Maximum Server Memory (Temporary Fix) If SQL Server continues to consume too much memory, limit the maximum memory usage: EXEC sp_configure 'show advanced options' , 1 ; RECONFIGURE; EXEC sp_configure 'max server memory...

Check MSSQL Database Size

Imej
  To check the size of your database in SQL Server , you can use the following query: Chatgpt - Refer this  https://chatgpt.com/share/681c2bc9-c948-8001-8530-d2563ec53c59 1. Check Database Size (Data + Log) USE YourDatabaseName; GO EXEC sp_spaceused; 2. Detailed Database Size (Data and Log Separately) SELECT      name AS FileName,     size * 8 / 1024 AS SizeMB,      max_size * 8 / 1024 AS MaxSizeMB,     physical_name AS FilePath,     type_desc AS FileType FROM sys.master_files WHERE database_id = DB_ID('YourDatabaseName'); 3. Size of All Databases on the Server SELECT      DB_NAME(database_id) AS DatabaseName,     SUM(size * 8 / 1024) AS SizeMB FROM sys.master_files GROUP BY database_id; Analysis and Recommendations: High Index Size: Your index size is almost as large as your data size (4.09 GB for indexes vs 4.83 GB for data). This suggests you may have many indexes , including unused ...

PowerBI: Data Visualisation Assignment

  Refer link:  Keyword on Google: bad data visualization examples bad dashboard examples powerbi link 9 Bad Data Visualization Examples That You Can Learn From - https://www.gooddata.com/blog/bad-data-visualization-examples-that-you-can-learn-from/ Bad Data Visualization: 9 Examples to Learn From -  https://www.luzmo.com/blog/bad-data-visualization Dashboard examples: The good, the bad and the ugly -  https://www.matillion.com/blog/dashboard-examples-the-good-the-bad-and-the-ugly Power BI Dashboard Design: Avoid These 7 Common Mistakes -  https://zebrabi.com/power-bi-dashboard-design/ reddit discussion https://www.reddit.com/r/dataisugly/search/?q=poor+data+visualization+examples&cId=c9ce09ee-ddf4-40c4-8a97-82924c068004&iId=99a2075f-2971-4e17-8c45-ab4557e4c16e

Python ML: Load dataset

Imej
Load data from default repo Just open the command prompt and type code as below > python Python 3.12.2 (tags/v3.12.2:6abddd9, Feb  6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.     >>> import sklearn >>> print(sklearn.__version__)   1.6.1   >>> from sklearn import datasets >>> dir(datasets)   ['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__getattr__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_arff_parser', '_base', '_california_housing', '_covtype', '_kddcup99', '_lfw', '_olivetti_faces', '_openml', '_rcv1', '_samples...

SQL Server size limit

Imej
  Truncate to reduce

MSSQL Deadlock

 SELECT * FROM sys.dm_tran_locks; SELECT creation_time, total_rows, text FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) order by creation_time desc SELECT      blocking_session_id AS BlockingSession,     session_id AS BlockedSession,     wait_type, wait_time, wait_resource FROM sys.dm_exec_requests WHERE blocking_session_id <> 0;

Comparing the Evaluation Results of Processed and Reduced Datasets Using Excel

 Since your dataset was reduced from all attributes to only two (Status & Target) , you should compare the evaluation metrics (e.g., accuracy, precision, recall, F1-score) of the classification models before and after reduction. 1. Collect Evaluation Results from Weka After running classification models on both datasets ( full dataset and reduced dataset ), record the following metrics: Accuracy (%) Precision (%) Recall (%) F1-Score (%) Cross-validation (k=10, k=20) results Percentage split (70:30, 80:20) results 2. Organizing Data in Excel Step 1: Create a Table in Excel Format your results into a table: Dataset Model Accuracy (%) Precision (%) Recall (%) F1-Score (%) Full (Before Reduction) J48 85 84 83 84 Full (Before Reduction) Random Forest 88 87 86 87 Reduced (After Reduction) J48 75 74 73 74 Reduced (After Reduction) Random Forest 78 77 76 77 Step 2: Insert a Bar Chart Select the table data. Go to Insert →...

Brute Force Approach - Algorithm Design Technique

Imej
Sam Kas Co is a shipping company that owns six ships. In emergency cases, the company will release the coordinates of each ship to other ships. The nearest ship will be assigned to help the trouble ship. Assume now that a ship. MayDay with coordinate (10,5), is in trouble. Table below shows the current coordinates for all the other ships.   Ship Name Coordinate X Coordinate Y Air 18 11 Bay 7 1 Cell 3 7 Dream 11 4 Eve 6 6   1.       Write a pseudocode that receives the coordinate of the troubled ships and a list of other ships’ coordinates. The algorithm will return coordinate that of the nearest ship to the troubled ship.   FindNearestShip(troubleShipX, troubleShipY, ship_list)       minDistance = INFINITE   ...