Description:
Hi,
I have db which has around 400k records, I have created view in SQL with some joins, when I try to fetch data with that view I got query
{SELECT
`Extent1`.`ParticipantName`,
`Extent1`.`ParticipantFullAddress`,
`Extent1`.`TeamNameWithoutSpaces`,
`Extent1`.`idevent_participants`,
`Extent1`.`EventId`,
`Extent1`.`MainClass`,
`Extent1`.`Subclass`,
`Extent1`.`part_participantId`,
`Extent1`.`eventTeamId`,
`Extent1`.`Version`,
`Extent1`.`IsDeleted`,
`Extent1`.`DeletionDate`,
`Extent1`.`OrderNumber`
FROM (SELECT
`participantfieldsdtoview`.`ParticipantName`,
`participantfieldsdtoview`.`ParticipantFullAddress`,
`participantfieldsdtoview`.`TeamNameWithoutSpaces`,
`participantfieldsdtoview`.`idevent_participants`,
`participantfieldsdtoview`.`EventId`,
`participantfieldsdtoview`.`MainClass`,
`participantfieldsdtoview`.`Subclass`,
`participantfieldsdtoview`.`part_participantId`,
`participantfieldsdtoview`.`eventTeamId`,
`participantfieldsdtoview`.`Version`,
`participantfieldsdtoview`.`IsDeleted`,
`participantfieldsdtoview`.`DeletionDate`,
`participantfieldsdtoview`.`OrderNumber`
FROM `participantfieldsdtoview` AS `participantfieldsdtoview`) AS `Extent1`}
Because of this I am getting Timeout Exception
but when I use the same view in workbench it works perfectly, within 2 2nd display 1000 Rec.
SELECT * FROM participantfieldsdtoview
How to repeat:
1 - Create View in DB
2 - Import in C# MVC project with Entity Framwork 5 DB first
3 - Make Query
var parts= _parts.GetAll()
Suggested fix:
it would be perfect to make query as simple as it is with some where clause if they are there
SELECT
`participantfieldsdtoview`.`ParticipantName`,
`participantfieldsdtoview`.`ParticipantFullAddress`,
`participantfieldsdtoview`.`TeamNameWithoutSpaces`,
`participantfieldsdtoview`.`idevent_participants`,
`participantfieldsdtoview`.`EventId`,
`participantfieldsdtoview`.`MainClass`,
`participantfieldsdtoview`.`Subclass`,
`participantfieldsdtoview`.`part_participantId`,
`participantfieldsdtoview`.`eventTeamId`,
`participantfieldsdtoview`.`Version`,
`participantfieldsdtoview`.`IsDeleted`,
`participantfieldsdtoview`.`DeletionDate`,
`participantfieldsdtoview`.`OrderNumber`
FROM `participantfieldsdtoview`
Description: Hi, I have db which has around 400k records, I have created view in SQL with some joins, when I try to fetch data with that view I got query {SELECT `Extent1`.`ParticipantName`, `Extent1`.`ParticipantFullAddress`, `Extent1`.`TeamNameWithoutSpaces`, `Extent1`.`idevent_participants`, `Extent1`.`EventId`, `Extent1`.`MainClass`, `Extent1`.`Subclass`, `Extent1`.`part_participantId`, `Extent1`.`eventTeamId`, `Extent1`.`Version`, `Extent1`.`IsDeleted`, `Extent1`.`DeletionDate`, `Extent1`.`OrderNumber` FROM (SELECT `participantfieldsdtoview`.`ParticipantName`, `participantfieldsdtoview`.`ParticipantFullAddress`, `participantfieldsdtoview`.`TeamNameWithoutSpaces`, `participantfieldsdtoview`.`idevent_participants`, `participantfieldsdtoview`.`EventId`, `participantfieldsdtoview`.`MainClass`, `participantfieldsdtoview`.`Subclass`, `participantfieldsdtoview`.`part_participantId`, `participantfieldsdtoview`.`eventTeamId`, `participantfieldsdtoview`.`Version`, `participantfieldsdtoview`.`IsDeleted`, `participantfieldsdtoview`.`DeletionDate`, `participantfieldsdtoview`.`OrderNumber` FROM `participantfieldsdtoview` AS `participantfieldsdtoview`) AS `Extent1`} Because of this I am getting Timeout Exception but when I use the same view in workbench it works perfectly, within 2 2nd display 1000 Rec. SELECT * FROM participantfieldsdtoview How to repeat: 1 - Create View in DB 2 - Import in C# MVC project with Entity Framwork 5 DB first 3 - Make Query var parts= _parts.GetAll() Suggested fix: it would be perfect to make query as simple as it is with some where clause if they are there SELECT `participantfieldsdtoview`.`ParticipantName`, `participantfieldsdtoview`.`ParticipantFullAddress`, `participantfieldsdtoview`.`TeamNameWithoutSpaces`, `participantfieldsdtoview`.`idevent_participants`, `participantfieldsdtoview`.`EventId`, `participantfieldsdtoview`.`MainClass`, `participantfieldsdtoview`.`Subclass`, `participantfieldsdtoview`.`part_participantId`, `participantfieldsdtoview`.`eventTeamId`, `participantfieldsdtoview`.`Version`, `participantfieldsdtoview`.`IsDeleted`, `participantfieldsdtoview`.`DeletionDate`, `participantfieldsdtoview`.`OrderNumber` FROM `participantfieldsdtoview`