Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -361,7 +361,7 @@ |
362 | 362 | case SMW_SQL2_TEXT2: |
363 | 363 | $res = $db->select( 'smw_text2', 'value_blob', |
364 | 364 | 'p_id=' . $db->addQuotes($pid), |
365 | | - 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions) ); |
| 365 | + 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions) ); ///NOTE: Do not add DISTINCT here for performance reasons |
366 | 366 | while($row = $db->fetchObject($res)) { |
367 | 367 | $dv = SMWDataValueFactory::newPropertyObjectValue($property); |
368 | 368 | $dv->setOutputFormat($outputformat); |
— | — | @@ -375,7 +375,7 @@ |
376 | 376 | 'smw_namespace, smw_title, smw_iw', |
377 | 377 | 'p_id=' . $db->addQuotes($pid) . ' AND o_id=smw_id' . |
378 | 378 | $this->getSQLConditions($requestoptions,'smw_sortkey','smw_sortkey'), |
379 | | - 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,'smw_sortkey') ); |
| 379 | + 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,'smw_sortkey') + array('DISTINCT') ); |
380 | 380 | while($row = $db->fetchObject($res)) { |
381 | 381 | $dv = SMWDataValueFactory::newPropertyObjectValue($property); |
382 | 382 | $dv->setOutputFormat($outputformat); |
— | — | @@ -396,7 +396,7 @@ |
397 | 397 | $res = $db->select( 'smw_atts2', 'value_unit, value_xsd', |
398 | 398 | 'p_id=' . $db->addQuotes($pid) . |
399 | 399 | $this->getSQLConditions($requestoptions,$value_column,'value_xsd'), |
400 | | - 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,$value_column) ); |
| 400 | + 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,$value_column) + array('DISTINCT') ); |
401 | 401 | while($row = $db->fetchObject($res)) { |
402 | 402 | $dv = SMWDataValueFactory::newPropertyObjectValue($property); |
403 | 403 | $dv->setOutputFormat($outputformat); |