mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: cast hid parameter to char(6) in GetMemberByHid query
avoids casting the hid column, which does a full table scan, which is slow
This commit is contained in:
parent
b0e1a7b9ff
commit
492cce6223
1 changed files with 1 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ public partial class ModelRepository
|
||||||
|
|
||||||
public Task<PKMember?> GetMemberByHid(string hid, SystemId? system = null)
|
public Task<PKMember?> GetMemberByHid(string hid, SystemId? system = null)
|
||||||
{
|
{
|
||||||
var query = new Query("members").Where("hid", hid.ToLower());
|
var query = new Query("members").WhereRaw("hid = (?)::char(6)", hid.ToLower());
|
||||||
if (system != null)
|
if (system != null)
|
||||||
query = query.Where("system", system);
|
query = query.Where("system", system);
|
||||||
return _db.QueryFirst<PKMember?>(query);
|
return _db.QueryFirst<PKMember?>(query);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue