Hello,

I'm working on a SQLite layer for Drupal as a hobby. It's very functional, but I have the following problem: your module uses some queries with COUNT(DISTINCT(...)). I'm not sure is this syntax is SQL standard, but it can by rewritten using a GROUP BY clause (in a 100% standard way). For instance:
line 83: 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)'; could be replaced with 'SELECT COUNT(*) FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)'; . ' GROUP BY n.nid';

You may notice that the queries I'm suggesting are shorter, cleaner (you may cleary see that you are counting all the lines) and maybe faster (because of possible GROUP BY optimizations).

Best wishes,
Andrei.

CommentFileSizeAuthor
#1 tracker_4.patch1.38 KBabautu

Comments

abautu’s picture

Assigned: Unassigned » abautu
Status: Active » Reviewed & tested by the community
StatusFileSize
new1.38 KB

I learned how to use a CVS, how Drupal CVS works, how patches are made and I thought to give it a try. I've tested the patch on my installation.

Crell’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

1) Do not post duplicate issues to different issue queues.
2) Do not set your own patch to "ready to be committed".
3) New features go against 6.x, not against the stable version.
4) Do check the issue queue before posting, as there is already an effort for SQLite support: http://drupal.org/node/67349

Thank you.