perf: add select narrowing to llm_calls.findUnique on detail page
Exclude 8 unused columns from the llm_calls detail page query, including large JSON blobs (messages, parsed_response, context) and unused scalar fields (max_tokens, retry_count, user_id, python_version, is_async). This reduces payload size from the database for every LLM call detail page view.
This commit is contained in:
parent
817e588425
commit
1ef61d1e76
1 changed files with 24 additions and 0 deletions
|
|
@ -28,6 +28,30 @@ export default async function LLMCallDetailPage(props: LLMCallDetailPageProps) {
|
|||
const [llmCall, relatedErrors] = await Promise.all([
|
||||
prisma.llm_calls.findUnique({
|
||||
where: { id: params.id },
|
||||
select: {
|
||||
id: true,
|
||||
trace_id: true,
|
||||
call_type: true,
|
||||
model_name: true,
|
||||
system_prompt: true,
|
||||
user_prompt: true,
|
||||
temperature: true,
|
||||
n_candidates: true,
|
||||
raw_response: true,
|
||||
prompt_tokens: true,
|
||||
completion_tokens: true,
|
||||
total_tokens: true,
|
||||
llm_cost: true,
|
||||
latency_ms: true,
|
||||
status: true,
|
||||
error_type: true,
|
||||
error_message: true,
|
||||
parsing_status: true,
|
||||
candidates_generated: true,
|
||||
candidates_valid: true,
|
||||
parsing_errors: true,
|
||||
created_at: true,
|
||||
},
|
||||
}),
|
||||
prisma.optimization_errors.findMany({
|
||||
where: { llm_call_id: params.id },
|
||||
|
|
|
|||
Loading…
Reference in a new issue