mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-30 18:17:53 +00:00 
			
		
		
		
	 0162f42a1d
			
		
	
	
		0162f42a1d
		
			
		
	
	
	
	
		
			
			* Fix #20621: User Status Tracking in the System * Fix #20621: User Status Tracking in the System * Fix #20621: Add Playwright tests * Update generated TypeScript types * fix import * remove unused imports and fix broken ui for settings user page * revert path change for PersonaDetailsPage * fix unit tests * fix tests * Add separate api for last login time * update last login time api * remove last login time patch * remove updateLoginTime --------- Co-authored-by: shrushti2000 <shrushtipolekar@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com>
		
			
				
	
	
		
			27 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			SQL
		
	
	
	
	
	
| -- Add generated columns for lastLoginTime and lastActivityTime to user_entity table for efficient querying of online users
 | |
| ALTER TABLE user_entity 
 | |
| ADD COLUMN lastLoginTime BIGINT UNSIGNED GENERATED ALWAYS AS (json_unquote(json_extract(`json`, '$.lastLoginTime'))) VIRTUAL;
 | |
| 
 | |
| ALTER TABLE user_entity 
 | |
| ADD COLUMN lastActivityTime BIGINT UNSIGNED GENERATED ALWAYS AS (json_unquote(json_extract(`json`, '$.lastActivityTime'))) VIRTUAL;
 | |
| 
 | |
| CREATE INDEX idx_user_entity_last_login_time ON user_entity(lastLoginTime);
 | |
| CREATE INDEX idx_user_entity_last_activity_time ON user_entity(lastActivityTime);
 | |
| CREATE INDEX idx_user_entity_last_login_deleted ON user_entity(lastLoginTime, deleted);
 | |
| CREATE INDEX idx_user_entity_last_activity_deleted ON user_entity(lastActivityTime, deleted);
 | |
| 
 | |
| -- Composite index for apps_extension_time_series to fix "Out of sort memory" error
 | |
| -- This index optimizes the query: WHERE appId = ? AND extension = ? ORDER BY timestamp DESC
 | |
| CREATE INDEX idx_apps_extension_composite 
 | |
| ON apps_extension_time_series(appId, extension, timestamp DESC);
 | |
| 
 | |
| CREATE INDEX idx_er_toEntity_toId_relation
 | |
| ON entity_relationship (toEntity, toId, relation);
 | |
| 
 | |
| CREATE INDEX idx_er_fromEntity_toEntity 
 | |
| ON entity_relationship (fromEntity, toEntity);
 | |
| 
 | |
| CREATE INDEX idx_er_relation_fromEntity_toId 
 | |
| ON entity_relationship (relation, fromEntity, toId);
 | |
| 
 |