Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 179
Total: 180

Author Topic: search entire gallery setting ?  (Read 6770 times)

0 Members and 1 Guest are viewing this topic.

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
search entire gallery setting ?
« on: June 20, 2011, 08:23:56 am »
I checked the forum but did not find an answer. Is there a way to prevent users to search the entire gallery ?

I actually have a gallery with 10000+ images and from time to time, the web server has to handle a long request. The last one is :

Code: [Select]
Query_time: 381
Lock_time: 0
Rows_sent: 10626
Rows_examined: 120771768

SELECT
                               COUNT(*) as total
                       FROM (forum1_gallery_pic as p, forum1_gallery_comment as com)

               LEFT JOIN forum1_members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
               LEFT JOIN forum1_gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
               LEFT JOIN forum1_gallery_log_mark_view AS v ON (p.ID_PICTURE = v.ID_PICTURE AND v.ID_MEMBER = 25659 AND v.user_id_cat = p.USER_ID_CAT)
                                       WHERE ((s.private =0 || s.private IS NULL ) AND (s.password = '' || s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.a
pproved =1) || (p.approved =1 AND p.USER_ID_CAT =0)   AND com.ID_PICTURE = p.ID_PICTURE GROUP BY p.ID_PICTURE;

I wonder how to prevent a guest user/registered user to start search a search.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: search entire gallery setting ?
« Reply #1 on: June 20, 2011, 08:32:36 am »
That query from above is not from search but from the "recentcomments" index display box on the gallery index

If you can do a quick test for me see how long this one takes
Code: [Select]
SELECT
                               COUNT(*) as total
                       FROM (forum1_gallery_pic as p, forum1_gallery_comment as com)

               LEFT JOIN forum1_members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
               LEFT JOIN forum1_gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
               LEFT JOIN forum1_gallery_log_mark_view AS v ON (p.ID_PICTURE = v.ID_PICTURE AND v.ID_MEMBER = 25659 AND v.user_id_cat = p.USER_ID_CAT)
                                       WHERE com.ID_PICTURE = p.ID_PICTURE AND ((s.private =0 || s.private IS NULL ) AND (s.password = '' || s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.a
pproved =1) || (p.approved =1 AND p.USER_ID_CAT =0)   GROUP BY p.ID_PICTURE;

If you need to code to disable the search let me know along with the SMF version used
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #2 on: June 20, 2011, 08:54:03 am »
I just ran the query from phpMyAdmin as the previous one was read in the server log :

SELECT COUNT( * ) AS total
FROM (
forum1_gallery_pic AS p, forum1_gallery_comment AS com
)
LEFT JOIN forum1_members AS m ON ( m.ID_MEMBER = p.ID_MEMBER )
LEFT JOIN forum1_gallery_usersettings AS s ON ( s.ID_MEMBER = m.ID_MEMBER )
LEFT JOIN forum1_gallery_log_mark_view AS v ON ( p.ID_PICTURE = v.ID_PICTURE
AND v.ID_MEMBER =25659
AND v.user_id_cat = p.USER_ID_CAT )
WHERE com.ID_PICTURE = p.ID_PICTURE
AND (
(
s.private =0 || s.private IS NULL
)
AND (
s.password = '' || s.password IS NULL
)
AND p.USER_ID_CAT !=0
AND p.approved =1
) || ( p.approved =1
AND p.USER_ID_CAT =0 )
GROUP BY p.ID_PICTURE
LIMIT 0 , 30


The answer is : Affichage des lignes 0 - 29 (1 620 total, Traitement en 9.3797 sec.)

in english : display for lines 0 - 29 (1 620 in total, execution time 9.3797 sec.)

did it help ??

Gallery version is 3.0.22

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #3 on: June 20, 2011, 08:56:31 am »
oopppss, just realized that phpMyAdmin allows only 30 results to be displayed.

I can ask my server admin to run the full query ...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: search entire gallery setting ?
« Reply #4 on: June 20, 2011, 09:06:17 am »
What SMF Version are you using going to try something
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #5 on: June 20, 2011, 09:09:06 am »
SMF is 1.1.14

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: search entire gallery setting ?
« Reply #6 on: June 20, 2011, 09:18:32 am »
It was actually the listall feature for the recent comments block.

Made a couple changes copy this file to your sources folder and let me know if it helps
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #7 on: June 20, 2011, 11:02:18 am »
Here is the result of the query as requested :

# Query_time: 29  Lock_time: 0  Rows_sent: 1611  Rows_examined: 23626208

Will check your file and let you know ... :)

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
4668 Views
Last post August 06, 2007, 09:34:02 pm
by rumboogy
1 Replies
3531 Views
Last post February 25, 2009, 10:47:25 pm
by SMFHacks
2 Replies
4513 Views
Last post May 27, 2012, 07:05:37 pm
by VinnyH
2 Replies
3418 Views
Last post December 19, 2014, 08:08:57 am
by Jonas1975
1 Replies
3191 Views
Last post December 29, 2016, 10:09:18 am
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal