permify icon indicating copy to clipboard operation
permify copied to clipboard

Feat/index optimization and benchmarking

Open sayfshaikh opened this issue 3 years ago • 1 comments

Fixes: #863 /claim #863

Optimization Process

Initial Analysis

Description: Conducted an analysis of the current indexing strategy to identify potential areas for improvement.
Tools Used: PgHero and Dexter
Findings: Identified the need to delete idx_tuples_entity and add idx_attributes_tenant_created_tx for optimization.

Index Optimization

Optimization Strategies: Implemented specific index optimizations.

  1. Deleted Index: idx_tuples_entity
  2. Added Index: idx_attributes_tenant_created_tx

Implementation Details: Executed SQL commands to delete and add indexes.

Benchmarking Setup

Environment Details

  • Postgres Version: 16
  • Operating System: Windows 11

Benchmarking Methodology

Query Tested: Checked queries from internal/engines folder.

  • Query 1: SELECT name, serialized_definition, version FROM public.schema_definitions WHERE name= :name AND version= :version AND tenant_id= :tenant_id' LIMIT 1;

Procedure: Described the benchmarking process, including the number of times each query is run and how metrics are collected.

Benchmark Results

Before Optimization

  • Query 1:
  • Average Execution Time: 0.393 ms

After Optimization

  • Query 1:
  • Average Execution Time: 0.054 ms

Analysis and Conclusions

Performance Improvements: Significant improvements in query performance were observed post-optimization.

Recommendations: Continue to monitor and analyze system performance. Consider further optimizations based on future usage patterns.

sayfshaikh avatar Nov 26 '23 11:11 sayfshaikh