mirror of https://github.com/grafana/grafana.git
				
				
				
			[release-11.6.6] search: Force index IDX_dashboard_title when searching dashboards (#111417)
search: Force index IDX_dashboard_title when searching dashboards (#110595)
(cherry picked from commit 726c7ba71b)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: maicon <maiconscosta@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									748f193f5e
								
							
						
					
					
						commit
						cfda836b8e
					
				|  | @ -149,7 +149,12 @@ func (b *Builder) applyFilters() (ordering string) { | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	b.sql.WriteString("SELECT dashboard.id FROM dashboard") | 	forceIndex := "" | ||||||
|  | 	if b.Dialect.DriverName() == migrator.MySQL { | ||||||
|  | 		forceIndex = " FORCE INDEX (IDX_dashboard_title) " | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	b.sql.WriteString(fmt.Sprintf("SELECT dashboard.id FROM dashboard %s", forceIndex)) | ||||||
| 	b.sql.WriteString(strings.Join(joins, "")) | 	b.sql.WriteString(strings.Join(joins, "")) | ||||||
| 
 | 
 | ||||||
| 	if len(wheres) > 0 { | 	if len(wheres) > 0 { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue