perf: select only needed columns from GisUat, skip geometry (~100MB)
This commit is contained in:
@@ -124,7 +124,11 @@ export async function GET(req: Request) {
|
|||||||
const url = new URL(req.url);
|
const url = new URL(req.url);
|
||||||
const withFeatures = url.searchParams.get("features") === "true";
|
const withFeatures = url.searchParams.get("features") === "true";
|
||||||
|
|
||||||
const rows = await prisma.gisUat.findMany({ orderBy: { name: "asc" } });
|
// CRITICAL: select only needed fields — geometry column has huge polygon data
|
||||||
|
const rows = await prisma.gisUat.findMany({
|
||||||
|
orderBy: { name: "asc" },
|
||||||
|
select: { siruta: true, name: true, county: true, workspacePk: true },
|
||||||
|
});
|
||||||
|
|
||||||
// Feature counts are expensive (scans entire GisFeature table)
|
// Feature counts are expensive (scans entire GisFeature table)
|
||||||
// Only include when explicitly requested
|
// Only include when explicitly requested
|
||||||
|
|||||||
Reference in New Issue
Block a user