Got a really weird problem with a query for Valentina Server 13.6.
Tables are mailbox for mailboxes, message for emails. The basic query gets information from the mailbox and the message table. Usually only one mailbox is shown with a where clause for the mailbox. The exception is "All Emails" where - as the name says - all emails are shown independent of the mailboxes.
The query for this has a placeholder where clause "(1)". This is super slow in Valentina Studio for Valentina Server.
The following query takes 10 seconds (!!!):
SELECT Message.MailboxID,Message.RecID,Message.OriginatorFrom as 'From',Message.ReceiverTo as 'To',Message.MainSubject as 'Subject',Message.MainDateTime as 'Date',Message.AttachmentCount as 'Att',Mailbox.MailboxpathName as 'Mailbox',lower(Message.OriginatorFrom) as 'Order_From',lower(Message.ReceiverTo) as 'Order_To',lower(Message.MainSubject) as 'Order_Subject' FROM (Message INNER JOIN Mailbox ON Message.MailboxID = Mailbox.RecID) WHERE ( Message.username in ('sa', '') ) AND ( 1 ) ORDER By "Date" ASC
Notice the "AND (1)".
The query without this part takes 0,35 seconds:
SELECT Message.MailboxID,Message.RecID,Message.OriginatorFrom as 'From',Message.ReceiverTo as 'To',Message.MainSubject as 'Subject',Message.MainDateTime as 'Date',Message.AttachmentCount as 'Att',Mailbox.MailboxpathName as 'Mailbox',lower(Message.OriginatorFrom) as 'Order_From',lower(Message.ReceiverTo) as 'Order_To',lower(Message.MainSubject) as 'Order_Subject' FROM (Message INNER JOIN Mailbox ON Message.MailboxID = Mailbox.RecID) WHERE ( Message.username in ('sa', '') ) ORDER By "Date" ASC
There is no such behavior for the Valentina ADK for Xojo. I could finagle the "AND (1)" out of my SQL building code - maybe. But I would like to know if this is a bug or my stupidity.